Can someone please help me with this error.
Unknown: UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fe286131e90>
I checked few stackoverflow links.
@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.
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
I had somthing similar and I check my images one by one with this code to verify the integrity! Try it!
from os import listdir
from PIL import Image
for filename in listdir(‘/content/dataset/your_file’):
if filename.endswith(‘.png’):
try:
img = Image.open(‘/content/dataset/your_file/’+filename) # open the image file
img.verify() # verify that it is, in fact an image
except (IOError) as e:
print(‘Bad file:’, filename)