Getting this error Unknown: UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fe286131e90>

Hi,

Can someone please help me with this error.
Unknown: UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fe286131e90>
I checked few stackoverflow links.

But seems in keras it is used internally

Below is the colab notebook for reproducibilty

Thanks and Regards,
Subho

@Subhobrata_Mukharjee I ran your note book after some debugging seems like there is issue with some of your image files encodings. I didn’t debug enough to figure out which ones but that should be a clue. PIL seems to throw that error in between training so, that’s another point towards image encoding errors.

1 Like

Hi Sid,
Thanks for the information.
Actually few of the images were corrupted therefore this issue occurred.
After removing the corrupt images it ran fine