0
from PIL import Image as image
img = image.open(filename)
img = img.resize((640,640))

此代码在 Windows 中运行良好,但在 ubuntu 中出现了一些问题。错误是 Traceback(最近一次调用最后一次):

File "/home/prathprabhudesai/Imagga/Classifiertraining.py", line 82, in <module>
    img = img.resize((640,640))                           #Resize 
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1318, in resize
    self.load()
  File "/usr/lib/python2.7/dist-packages/PIL/ImageFile.py", line 192, in load
    d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
AttributeError: 'module' object has no attribute '_getdecoder'
4

1 回答 1

0

我遇到了类似的问题,因为我使用的是 Spyder。检查这个线程:http ://comments.gmane.org/gmane.comp.python.scientific.spyder/2465

于 2013-10-20T13:24:59.850 回答