简体   繁体   English

运行ChainerCV的“检测”演示时未获得正确的输出

[英]Not getting proper output while running 'detection' demo of ChainerCV

I am trying to run a 'detection' demo of ChainerCV from here, https://github.com/chainer/chainercv/tree/master/examples/detection 我正在尝试从此处运行ChainerCV的``检测''演示, https://github.com/chainer/chainercv/tree/master/examples/detection

I am running this demo in BitFusion Ubuntu 14.04 Chainer AMI on AWS with a p2.xlarge instance which uses a single GPU. 我正在使用单个GPU的p2.xlarge实例在AWS上的BitFusion Ubuntu 14.04 Chainer AMI上运行此演示。

When I try to run this demo at first I am getting this error, 刚开始尝试运行此演示时,出现此错误,

no display name and no $DISPLAY environment variable 没有显示名称,也没有$ DISPLAY环境变量

So I researched it on the web and get a solution for using matplotlib with AGG engine, so I tried to import that and use agg. 因此,我在网络上对其进行了研究,并获得了将matplotlib与AGG引擎结合使用的解决方案,因此我尝试将其导入并使用agg。 That does solve the problem of $DISPLAY but now when I run the demo it gets executed successfully but as an output, all I get is a white blank image. 确实解决了$ DISPLAY的问题,但是现在当我运行演示时,它已成功执行,但作为输出,我得到的只是一个白色的空白图像。

Can anyone tell me the reason behind this? 谁能告诉我背后的原因吗?

The problem seems that you run the demo program in remote machine and X is not properly set. 问题似乎是您在远程计算机上运行了演示程序,并且X设置不正确。 You can get proper matplotlib output when you connect to your remote machine with ssh -X <your.remote.machine.address> , but it will takes time to show the resultt. 使用ssh -X <your.remote.machine.address>连接到远程计算机时,可以获得适当的matplotlib输出,但是显示结果将花费一些时间。

If you want to run demo in remote machine quickly, i recommend you to set MPLBACKEND=Agg , save plot figure as image by plt.savefig(<imagepath>) and do not run plt.show() in demo program. 如果要在远程计算机上快速运行演示,建议您设置MPLBACKEND=Agg ,通过plt.savefig(<imagepath>)将绘图保存为图像,并且不要在演示程序中运行plt.show()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM