-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'GDK_IS_DISPLAY (display)' failed #861
Comments
It is a downstream problem of matplotlib not being able to find display. What is the output if you run "echo $DISPLAY"? Usually, running ssh with an X session (using ssh -X) will solve that problem. |
On Mac with ssh -X, I can run the script for a while (about 10-20 min), after that the above error occurs again and I have to start a new session... |
I was having this same issue. As @Yangqing suggested, running ssh -X will fix the problem. I'm using an OSX machine. The easiest way to do this is
|
Keeping an X session open is a little bit tricky indeed. If you have a reasonably fast network, try starting a VNC or NX server and then connect with GUI - that usually handles things better. Or, use an ipython notebook on the server, allow remote connection to the notebook, and work from there. |
If you are on Mac, add this "ForwardX11Timeout 596h" to the file /etc/ssh_config. Hope this helps. |
For me it seems to be
Which will tell |
Thanks @jashmenn - your solution works perfectly. |
Thanks @jashmenn ! |
Now I could login through ssh and my issue is solved! Now, access the site and create the dataset! |
In similar spirit to @jashmenn, it is possible to specify this at runtime or set an environment variable: |
sudo pip uninstall matplotlib use python-matplotlib can solve the problom. |
I was having that problem on my Raspberry Pi and using what @LaurenLuoYun said solved my problem. |
I had the same problem, and to me the solution was: |
@unifiDa It is a nice solution. Thanks! |
Solved my problems. Thanks @jashmenn |
Solution to 'GDK_IS_DISPLAY (display)' failed It seems that the error is a minor error during the ssh connection from a computer to another computer. While I run the test application of class_activation_maps.py (keras examples), it shows the same error. $ python3 class_activation_maps.py /home/nvidia/Downloads/galaxy.jpg (image_ocr.py:1257): Gdk-CRITICAL **: 19:44:35.690: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed Using TensorFlow backend. However, while I run the following both the commands and the application. It can successfully show the splendid galaxy makeup. $ echo $DISPLAY Using TensorFlow backend. Notes: Another solution is to describe the above-metioned commands in bashrc. Cheers, Mike |
I was not able to run classify.py via SSH.
I don't want to use X11 during classification, is there any way to avoid that?
zxi@pearl:~/repo/CNN/scripts$ ./classify.py 12.png out
(classify.py:28845): Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
Traceback (most recent call last):
File "./classify.py", line 14, in
import caffe
File "/home/zxi/repo/CNN/scripts/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver
File "/home/zxi/repo/CNN/scripts/caffe/pycaffe.py", line 11, in
import caffe.io
File "/home/zxi/repo/CNN/scripts/caffe/io.py", line 2, in
import skimage.io
File "/usr/local/lib/python2.7/dist-packages/skimage/io/init.py", line 15, in
reset_plugins()
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 91, in reset_plugins
_load_preferred_plugins()
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 71, in _load_preferred_plugins
_set_plugin(p_type, preferred_plugins['all'])
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 83, in _set_plugin
use_plugin(plugin, kind=plugin_type)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 253, in use_plugin
_load(name)
File "/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py", line 297, in _load
fromlist=[modname])
File "/usr/local/lib/python2.7/dist-packages/skimage/io/_plugins/matplotlib_plugin.py", line 1, in
import matplotlib.pyplot as plt
File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 98, in
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/init.py", line 28, in pylab_setup
globals(),locals(),[backend_name],0)
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3agg.py", line 7, in
import backend_gtk3
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py", line 49, in
cursors.MOVE : Gdk.Cursor.new(Gdk.CursorType.FLEUR),
TypeError: constructor returned NULL
The text was updated successfully, but these errors were encountered: