bethgelab / stylize-datasets

A script that applies the AdaIN style transfer method to arbitrary datasets
Other
155 stars 37 forks source link

local variable 'photoshop' referenced before assignment #4

Closed kampelmuehler closed 5 years ago

kampelmuehler commented 5 years ago

Getting the following traceback

Traceback (most recent call last): File "stylize.py", line 150, in main() File "stylize.py", line 117, in main style_img = Image.open(style_path).convert('RGB') File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/Image.py", line 2690, in open im = _open_core(fp, filename, prefix) File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/Image.py", line 2676, in _open_core im = factory(fp, filename) File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/JpegImagePlugin.py", line 783, in jpeg_factory im = JpegImageFile(fp, filename) File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/ImageFile.py", line 103, in init self._open() File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/JpegImagePlugin.py", line 373, in _open handler(self, i) File "/home/moritz/anaconda3/envs/adain/lib/python3.7/site-packages/PIL/JpegImagePlugin.py", line 139, in APP self.info["photoshop"] = photoshop UnboundLocalError: local variable 'photoshop' referenced before assignment

after around 300 images have been processed.

Any thoughts?

kampelmuehler commented 5 years ago

Ok, It's a PIL issue, that apparently doesn't occur in 5.4.1. See https://github.com/python-pillow/Pillow/issues/3769.

Hvitgar commented 5 years ago

Btw: It will be fixed in the upcoming PIL release