Media-Smart / vedastr

A scene text recognition toolbox based on PyTorch
Apache License 2.0
535 stars 100 forks source link

OSError: image file is truncated (43 bytes not processed) #72

Open Vietanh239 opened 3 years ago

Vietanh239 commented 3 years ago

I ran own my train data and got a problem with Pillow. I have installed Pillow==6.2.2 and Python==3.7

Here is my problem:

Original Traceback (most recent call last): File "/root/anaconda3/envs/test/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 202, in _worker_loop data = fetcher.fetch(index) File "/root/anaconda3/envs/test/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/anaconda3/envs/test/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "tools/../vedastr/datasets/lmdb_dataset.py", line 81, in getitem img, label = self.read_data(index) File "tools/../vedastr/datasets/lmdb_dataset.py", line 73, in read_data img = Image.open(buf).convert('RGB') # for color image File "/root/anaconda3/envs/test/lib/python3.7/site-packages/PIL/Image.py", line 930, in convert self.load() File "/root/anaconda3/envs/test/lib/python3.7/site-packages/PIL/ImageFile.py", line 249, in load "(%d bytes not processed)" % len(b) OSError: image file is truncated (43 bytes not processed)

How to solve it? Thank you