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'