rrmina / fast-neural-style-pytorch

Fast Neural Style Transfer implementation in PyTorch :art: :art: :art:
321 stars 77 forks source link

"AttributeError: can't set attribute" #11

Open mixuala opened 4 years ago

mixuala commented 4 years ago

This error (in Colaboratory) is fixed by upgrading the Pillow package, skip Pillow==4.1.1

/usr/local/lib/python3.6/dist-packages/PIL/JpegImagePlugin.py in SOF(self, marker)
    144     n = i16(self.fp.read(2))-2
    145     s = ImageFile._safe_read(self.fp, n)
--> 146     self.size = i16(s[3:]), i16(s[1:])
    147 
    148     self.bits = i8(s[0])
osmarcedron commented 4 years ago

I think you have to upgrade Pillow, for getting rid of this error. Nevertheless, I got other one not maybe related to this one, that points out some problems with the image you are trying to load (first time this ever happened to me)

rrmina commented 4 years ago

Hi @mixuala!

Seems like there's a problem with the earlier versions of Pillow. As @osmarcedron suggested, this problem could be solved by upgrading your Pillow to its latest version (i.e. pip install Pillow -U).

I will change all the notebooks to reflect this. Thanks for reporting this issue.