首页  编辑  

python tools/demo.py错误no display name……

Tags: /计算机文档/Linux & Unix/   Date Created:
py-faster-rcnn运行demo.py错误:
python ./tools/demo.py 报错:
Traceback (most recent call last):
  File "tools/demo.py", line 149, in <module>
    demo(net, im_name)
  File "tools/demo.py", line 98, in demo
    vis_detections(im, cls, dets, thresh=CONF_THRESH)
  File "tools/demo.py", line 47, in vis_detections
    fig, ax = plt.subplots(figsize=(12, 12))
  File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 1176, in subplots
    fig = figure(**fig_kw)
  File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 539, in figure
    **kwargs)
  File "/usr/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 171, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 1049, in new_figure_manager_given_figure
    window = Tk.Tk(className="matplotlib")
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1828, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
解决方法:
在桌面下运行即可。实际上已经成功了,在显示的时候没有图形界面GUI,所以报错。
run command under desktop terminal (X-window) GUI.