TheLastBen / fast-stable-diffusion

fast-stable-diffusion + DreamBooth
MIT License
7.53k stars 1.31k forks source link

Captions Error - KeyError: 'RGBA' - OSError: cannot write mode RGBA as JPEG` #1205

Open chewtoys opened 1 year ago

chewtoys commented 1 year ago

source images are png


[/usr/local/lib/python3.8/dist-packages/PIL/JpegImagePlugin.py](https://localhost:8080/#) in _save(im, fp, filename)
    611     try:
--> 612         rawmode = RAWMODE[im.mode]
    613     except KeyError:

KeyError: 'RGBA'

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
3 frames
[/usr/local/lib/python3.8/dist-packages/PIL/JpegImagePlugin.py](https://localhost:8080/#) in _save(im, fp, filename)
    612         rawmode = RAWMODE[im.mode]
    613     except KeyError:
--> 614         raise OSError("cannot write mode %s as JPEG" % im.mode)
    615 
    616     info = im.encoderinfo

OSError: cannot write mode RGBA as JPEG```
maxixa commented 1 year ago

same here. cannot train with caption checked

TheLastBen commented 1 year ago

one of the images is just not readable by the pillow library

gaoming714 commented 5 months ago

It seems that it only read RGB(JPG), but can't read RGBA(PNG). Please try to use *.jpg .