【发布时间】:2017-03-06 21:25:21
【问题描述】:
我正在测试scipy.misc.imshow,我得到了RuntimeError:无法执行图像查看器。
我正在使用 Python3.4 并在 CentOS 7 上运行它。
import scipy.misc
img = scipy.misc.imread('Data/cat.jpg')
assert len(img.shape) == 3
img_resized = scipy.misc.imresize(img, (224, 224))
img_answer = (img_resized/255.0).astype('float32')
scipy.misc.imshow(img_answer)
我得到了一个错误:
sh: see: command not found
Traceback (most recent call last):
File "/usr/local/pycharm/helpers/pydev/pydev_run_in_console.py", line 71, in <module>
globals = run_file(file, None, None)
File "/usr/local/pycharm/helpers/pydev/pydev_run_in_console.py", line 31, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "/usr/local/pycharm/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/root/PycharmProjects/myVQA/testgood.py", line 6, in <module>
scipy.misc.imshow(img_answer)
File "/usr/lib64/python3.4/site-packages/scipy/misc/pilutil.py", line 442, in imshow
raise RuntimeError('Could not execute image viewer.')
RuntimeError: Could not execute image viewer.
它说找不到see 命令。 CentOS7 上的see 命令安装在哪里?我该如何解决这个问题?
我尝试将SCIPY_PIL_IMAGE_VIEWER=/bin/eog 添加到/etc/profile
但这似乎没有帮助。
【问题讨论】:
标签: python image scipy centos7 imshow