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

IndexError: index 257 is out of bounds for dimension 0 with size 256 #33

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

Comments

@Shuhul24
Copy link

Shuhul24 commented Nov 8, 2023

While running the script by @skylook in the repo, following error occurs constantly

Traceback (most recent call last):
  File "/home/shuhulh/superglue_train/train.py", line 180, in <module>
    for i, pred in enumerate(train_loader):
  File "/opt/conda/envs/superglue/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 628, in __next__
    data = self._next_data()
  File "/opt/conda/envs/superglue/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/superglue/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/superglue/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/superpoint_dataset.py", line 86, in __getitem__
    desc1, scores1 = self.superpoint.computeDescriptorsAndScores({ 'image': data_warped, 'keypoints': kps1_filtered })
  File "/home/shuhulh/superglue_train/models/superpoint.py", line 231, in computeDescriptorsAndScores
    scores = [s[tuple(k.t())] for s, k in zip(scores, keypoints)]
  File "/home/shuhulh/superglue_train/models/superpoint.py", line 231, in <listcomp>
    scores = [s[tuple(k.t())] for s, k in zip(scores, keypoints)]
IndexError: index 257 is out of bounds for dimension 0 with size 256

How to overcome this? Everytime I execute the code, the number in IndexError changes everytime.

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