Skip to content
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

服务器中报异常:QXcbConnection: Could not connect to display #23

Closed
whirlys opened this issue Aug 17, 2017 · 2 comments
Closed

Comments

@whirlys
Copy link

whirlys commented Aug 17, 2017

我在 windows下通过 xshell 访问 centos,在 centos 中运行 example 中的 tutorial_mnist.py 就报异常了:QXcbConnection: Could not connect to display
原因应该是服务器中不能运行 GUI 程序
错误的位置应该是 tutorial_mnist.py 中第 390 行左右用到的 tl.visualize ,再进去就是 tl.visualize 这个文件中的 import matplotlib.pyplot as plt
我的解决方法:在 tl.visualize 源码中把被注释掉的 matplotlib.use('Agg') 去掉注释,就可以了。
现在我想请问一下有没有其他途径可以解决这个问题呢?

@zsdonghao
Copy link
Member

你可以在你的代码最上面执行matplotlib.use('Agg')

@zsdonghao
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants