如何通过X11转发运行py-faster-rcnn [英] How to run py-faster-rcnn with X11 forwarding

查看:91
本文介绍了如何通过X11转发运行py-faster-rcnn的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ubuntu 14.04操作系统的g2.8xlarge EC-2实例上运行启用cuDNN的py-faster-rcnn。一切都已编译,似乎运行良好。我通过以下方式登录到远程实例:

I'm running py-faster-rcnn with cuDNN enabled on a g2.8xlarge EC-2 instance with Ubuntu 14.04 operating system. Everything's compiled and seems to be working fine. I log in to the remote instance via:

ssh -X -i "<key.pem>" ubuntu@<IP address>

我还输入命令: export DISPLAY =:0

运行 ./ tools / demo.py 输出看起来不错:

Loaded network /home/ubuntu/py-faster-rcnn/data/faster_rcnn_models/VGG16_faster_rcnn_final.caffemodel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/000456.jpg
Detection took 0.543s for 300 object proposals 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/000542.jpg
Detection took 0.506s for 161 object proposals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/001150.jpg
Detection took 0.507s for 194 object proposals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/001763.jpg
Detection took 0.507s for 196 object proposals
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo for data/demo/004545.jpg
Detection took 0.541s for 300 object proposals

但是图形输出不是在我的XQuartz窗口中呈现。

But graphical output is not rendered in my XQuartz window.

还有其他人解决吗?需要弄清楚如何使用具有本地可视化功能的AWS硬件。在此处进行了检查,但我无法解决问题: BVLC / caffe#861

Has anyone else solved this? Need to figure out how to use AWS hardware but with local visualization capabilities. Checked here, but I wasn't able to solve my problem: BVLC/caffe#861

编辑

以下是指向我的远程 sshd_config 和本地 ssh_config 文件。

Here are links to the my remote sshd_config and local ssh_config files.

以下是远程AWS服务器环境中请求的测试结果:

Here are the results of the requested tests in the remote AWS server env:

$ echo $DISPLAY 
localhost:10.0

$ DISPLAY=localhost:10.0 xhost && echo success
access control enabled, only authorized clients can connect
success

更新

运行命令 xeyes xcalc 会在本地客户端上产生预期的输出(第一眼为眼睛,第二眼为计算器)。这可能是python问题。要开始寻找那里。

Running the commands xeyes and xcalc on the remote machine after applying the above steps results in the expected output (eyes in the first place, a calculator in the second) on the local client. This is probably a python problem. Going to start looking there.

解决方案-更新PYTHON LIBRRIES

在确认我的系统已安装后为了在回复此帖子的人员的指导下支持X11转发,我专注于在python中运行一系列测试,以查看 matplotlib 是否与X11配合良好。您可以通过交互式运行此脚本来自己检查。如果 xcalc xeyes 可以正常工作,但是此脚本会产生错误,则问题出在python / matplotlib

After verifying that my system was setup to support X11 forwarding with the guidance of those who responded to this post, I focus on running a series of tests in python to see if matplotlib was playing well with X11. You can check this yourself by running this script interactively. If xcalc and xeyes work as expected, but this script produces an error, the problem lies with python/matplotlib.

此后,我已经解决了这个问题,所以我手头没有这个错误,但是在Ubuntu 14.04,g2.8xlarge EC2上修复的步骤是如下所示:

I've since fixed the problem so I don't have the error this produced on hand, but the steps to fix on an Ubuntu 14.04, g2.8xlarge EC2 were as follows:


  • 安装python gobject: sudo apt-get安装python-gobject-dev

  • 安装python-tk: sudo apt-get安装python-tk

  • 安装pygtk:


    • wget http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk- 2.24.0.tar.gz

    • tar -xvzf pygtk-2.24.0.tar.gz

    • cd pygtk-2.24.0

    • ./ configure

    • make

    • sudo进行安装

    • cd

    • Install python gobject: sudo apt-get install python-gobject-dev
    • Install python-tk: sudo apt-get install python-tk
    • Install pygtk:
      • wget http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.gz
      • tar -xvzf pygtk-2.24.0.tar.gz
      • cd pygtk-2.24.0
      • ./configure
      • make
      • sudo make install
      • cd

      • sudo pip卸载matplotlib

      • git clone https://github.com/matplotlib/matplotlib.git

      • cd matplotlib

      • sudo python setup.py install

      • cd

      • sudo pip uninstall matplotlib
      • git clone https://github.com/matplotlib/matplotlib.git
      • cd matplotlib
      • sudo python setup.py install
      • cd

      完成上述步骤后, python ./tools/demo.py py-faster-rcnn 根目录按预期返回边界框和类概率的图像。

      After going through the above steps, python ./tools/demo.py with the py-faster-rcnn root directory returns images of bounding boxes and class probabilities as expected.

      推荐答案

      我假设您的本地主机上正在运行X服务器,对吗?

      I assume that there is an X server running on your local host, right?

      要考虑2个文件:


      • / etc / ssh / ssh_config :它位于您的本地主机上;它与客户端命令一起使用: ssh

      • / etc / ssh / sshd_config :它位于远程实例上;它与在远程实例上运行的 sshd 服务器一起使用。

      • /etc/ssh/ssh_config: it is located on your local host; it is used with the client command: ssh.
      • /etc/ssh/sshd_config: it is located on the remote instance; it is used with the sshd server running on the remote instance.

      X11Forwarding是 X11DisplayOffset 10 是需要为 sshd :在远程实例上运行的ssh守护程序。在远程实例上编辑/ etc / ssh / sshd_config文件。更改后,也许 sshd 必须在远程实例上重新启动。

      X11Forwarding yes and X11DisplayOffset 10 are 2 values that need to be set for sshd: the ssh daemon running on the remote instance. Edit /etc/ssh/sshd_config file on the remote instance. Maybe the sshd must be restarted on the remote instance after the changes.

      再次连接 ssh -X ... ,并检查 DISPLAY的值变量。
      设置 X11DisplayOffset 10 时,以下示例是正确的:

      Connect again with ssh -X ..., and check the value of DISPLAY variable. The example below is correct when X11DisplayOffset 10 is set:

      # ssh -X -i "<key.pem>" ubuntu@<IP address>
      # echo $DISPLAY
      localhost:10.0
      

      如果 DISPLAY 变量未设置或未设置为另一个值(.bashrc .profile中的某些内容在登录时更改了其值),那么这就是一个问题。

      If the DISPLAY variable is not set or set to another value (something in .bashrc .profile etc changed its value at login), then this is an issue.

      另一种方法是使用 xhost 进行测试,并在同一行中设置环境:

      Another way is to test with xhost, and set the environment in the same line:

      # ssh -X -i "<key.pem>" ubuntu@<IP address>
      # DISPLAY=localhost:10.0 xhost && echo success
      

      如果显示错误消息,这是要解决的问题:编辑问题并添加错误消息。
      否则,将打印状态行和成功字,然后继续:

      If an error message is displayed, this is an issue to fix: edit your question and add the error message. Otherwise, a status line an the success word are printed, continue with:

      # DISPLAY=localhost:10.0 xcalc
      

      应在本地主机上打开一个窗口。最后继续:

      A window should open on the local host. Finally continue with:

      # DISPLAY=localhost:10.0 ./tools/demo.py
      

      这篇关于如何通过X11转发运行py-faster-rcnn的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆