1

我正在尝试使用 misc.imsave('lena.png', l) 它总是告诉我找不到 imsave。我阅读并寻找答案,但仍然没有任何线索。

我导入了 scipy 和 PIL 模块。

>>> import scipy
>>> from scipy import misc
>>> l = misc.lena()
>>> from PIL import Image
>>> misc.imsave('lena.png', l)
Traceback (most recent call last):
 File "<pyshell#53>", line 1, in <module>
  misc.imsave('lena.png', l)
AttributeError: 'module' object has no attribute 'imsave'

任何建议如何使它工作?

4

1 回答 1

0

尝试删除此行:

from PIL import Image

过去 PIL 导入存在问题(例如https://github.com/scipy/scipy/issues/1899)。也许问题没有完全解决。

于 2013-08-05T16:37:19.917 回答