SuperGlue-pytorch icon indicating copy to clipboard operation
SuperGlue-pytorch copied to clipboard

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

Open Shuhul24 opened this issue 1 year ago • 0 comments

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.

Shuhul24 avatar Nov 08 '23 10:11 Shuhul24