a-PyTorch-Tutorial-to-Transformers icon indicating copy to clipboard operation
a-PyTorch-Tutorial-to-Transformers copied to clipboard

Error in PyTorch DataLoder

Open MostafaMagdSalama opened this issue 5 years ago • 0 comments
trafficstars

i got this error when i train a model (srgan)

KeyError: Caught KeyError in DataLoader worker process 0. Original Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/content/drive/My Drive/PyTorch--master/datasets.py", line 67, in getitem img = Image.open(self.images[i], mode='r') KeyError: 0

i'm training the model in google colab thanks

MostafaMagdSalama avatar Feb 18 '20 19:02 MostafaMagdSalama