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

AttributeError: 'NoneType' object has no attribute 'shape' #32

Open
Shuhul24 opened this issue Nov 3, 2023 · 0 comments
Open

AttributeError: 'NoneType' object has no attribute 'shape' #32

Shuhul24 opened this issue Nov 3, 2023 · 0 comments

Comments

@Shuhul24
Copy link

Shuhul24 commented Nov 3, 2023

I am training the model on my dataset instead of what is mentioned on the github repository (COCO, etc.). While training following error occured:

Traceback (most recent call last):
  File "/home/shuhulh/superglue_train/train.py", line 164, in <module>
    for i, pred in enumerate(train_loader):
  File "/opt/conda/envs/animal-reid/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 628, in __next__
    data = self._next_data()
  File "/opt/conda/envs/animal-reid/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 671, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/opt/conda/envs/animal-reid/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/opt/conda/envs/animal-reid/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 58, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/shuhulh/superglue_train/load_data.py", line 30, in __getitem__
    width, height = image.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'

I don't understand why does it happen while training. Can you help me out what am I supposed to do here? Do I need to change the name of files (the images) in the image directory (they are usually numerical values).

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