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>
I also enter the command: export DISPLAY=:0
Running ./tools/demo.py
the output looks good:
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
But graphical output is not rendered in my XQuartz window.
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
EDIT
Here are links to the my remote sshd_config
and local ssh_config
files.
Here are the results of the requested tests in the remote AWS server env:
$ echo $DISPLAY
localhost:10.0
and
$ DISPLAY=localhost:10.0 xhost && echo success
access control enabled, only authorized clients can connect
success
UPDATE
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.
SOLUTION--UPDATE PYTHON LIBRARIES
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
.
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:
- 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
- If
matplotlib
was installed using a package manager, e.g.pip
, uninstall it and re-install from source:sudo pip uninstall matplotlib
git clone https://github.com/matplotlib/matplotlib.git
cd matplotlib
sudo python setup.py install
cd
- Not sure that this is necessary, but ran
sudo apt-get install xorg openbox
for good measure.
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.