Cannot write mode
Hello, I am trying to augment a small amount of images however i keep getting these errors.
any ideas?
see the below for errors
Processing <PIL.Image.Image image mode=RGB size=720x1280 at 0x11410B0F0>: 0%| | 4/1000 [00:05<22:02, 1.33s/ Samples] Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/JpegImagePlugin.py", line 620, in _save rawmode = RAWMODE[im.mode] KeyError: 'P'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/Users/roryhodgson/Desktop/Augmentor-master 3/Augmentor/Pipeline.py", line 246, in _execute images[i].save(os.path.join(augmentor_image.output_directory, save_name)) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/Image.py", line 1969, in save save_handler(self, fp, filename) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/PIL/JpegImagePlugin.py", line 622, in _save raise IOError("cannot write mode %s as JPEG" % im.mode) OSError: cannot write mode P as JPEG
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/roryhodgson/Desktop/Augmentor-master 3/wheels.py", line 21, in
Hi @AKJDM, are you perhaps working with PNGs that have an alpha channel? You could try setting the save file format to PNG so that they are not converted to JPEG on save.