Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'Image' object is not subscriptable #317

Open
Mai-Magdy opened this issue Jul 22, 2021 · 0 comments
Open

TypeError: 'Image' object is not subscriptable #317

Mai-Magdy opened this issue Jul 22, 2021 · 0 comments

Comments

@Mai-Magdy
Copy link

for i, (input, target) in enumerate(val_loader):
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 425, in reraise
raise self.exc_type(msg)
TypeError: Caught TypeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.7/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.7/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/content/gdrive/My Drive/Colab Notebooks/dataset.py", line 219, in getitem
img_group = self._get_frames(record, video_reader,segment_indices)
File "/content/gdrive/My Drive/Colab Notebooks/dataset.py", line 173, in _get_frames
process_data = self.transform(images)
File "/usr/local/lib/python3.7/dist-packages/torchvision/transforms/transforms.py", line 60, in call
img = t(img)
File "/content/gdrive/My Drive/Colab Notebooks/transforms.py", line 442, in call
if img_group[0].mode == 'L':
TypeError: 'Image' object is not subscriptable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant