Closed Airburner closed 2 years ago
UnidentifiedImageError Traceback (most recent call last) Cell In [35], line 26 23 return None 24 return Image.open(BytesIO(response.content)).convert("RGB") ---> 26 images = list(filter(None,[download_image(url) for url in urls])) 27 save_path = "./training_samples" 28 if not os.path.exists(save_path):
Cell In [35], line 26, in
Cell In [35], line 24, in download_image(url) 22 except: 23 return None ---> 24 return Image.open(BytesIO(response.content)).convert("RGB")
File /venv/lib/python3.8/site-packages/PIL/Image.py:3008, in open(fp, mode, formats) 3006 for message in accept_warnings: 3007 warnings.warn(message) -> 3008 raise UnidentifiedImageError( 3009 "cannot identify image file %r" % (filename if filename else fp) 3010 )
UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f0981e1e950>
Try restarting the kernel? I was stuck for a while but worked after restarting
Thanks, I think that changing file location from Gdrive to Dropbox helped.
Thanks, I think that changing file location from Gdrive to Dropbox helped.
Hey, wondering what you meant by this? That you were hosting your files on Dropbox but changed the URLs to Gdrive and that got you past this error? I'm having the same error hosting my photos on imgur.
EDIT: I got past this step because I was uploading my imgur files without a .png extension. I put .png on the end of the imgur url and it worked
Yes, it was problem with img hosting server and link, now I am using dropbox and it's ok!
Hey I have error:
UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f0981e1e950>
When I try to load images to train the model