Spaces:
Configuration error
issues with uploading images PIL.UnidentifiedImageError:
I am getting this error after uploading 10 images. what shall i do?
PIL.UnidentifiedImageError: cannot identify image file '/tmp/IMG_0239gyanx2y9.jpg'
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/routes.py", line 292, in run_predict
output = await app.blocks.process_api(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/blocks.py", line 1007, in process_api
result = await self.call_function(fn_index, inputs, iterator, request)
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/blocks.py", line 848, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "app.py", line 137, in train
file = Image.open(file_temp.name)
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/PIL/Image.py", line 3186, in open
raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file '/tmp/adamraudonis13_h0qr9t.jpg'
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/routes.py", line 292, in run_predict
output = await app.blocks.process_api(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/blocks.py", line 1007, in process_api
result = await self.call_function(fn_index, inputs, iterator, request)
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/blocks.py", line 848, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "app.py", line 137, in train
file = Image.open(file_temp.name)
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/PIL/Image.py", line 3186, in open
raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file '/tmp/adamraudonis1uwzh6rce.jpg'
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/routes.py", line 292, in run_predict
output = await app.blocks.process_api(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/blocks.py", line 1007, in process_api
result = await self.call_function(fn_index, inputs, iterator, request)
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/gradio/blocks.py", line 848, in call_function
prediction = await anyio.to_thread.run_sync(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 867, in run
result = context.run(func, *args)
File "app.py", line 137, in train
file = Image.open(file_temp.name)
File "/home/user/.pyenv/versions/3.8.9/lib/python3.8/site-packages/PIL/Image.py", line 3186, in open
raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file '/tmp/adamraudonis18ha3qqrk.jpg'
Seems like one of the images is corrupted