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

Issue when training on custom Dataset. #14

Open
FOD-UNOmaha opened this issue Feb 21, 2021 · 0 comments
Open

Issue when training on custom Dataset. #14

FOD-UNOmaha opened this issue Feb 21, 2021 · 0 comments

Comments

@FOD-UNOmaha
Copy link

I am attempting to train this SSD implementation using a custom dataset. However, I consistently get this issue and I have not yet found the cause:

----------------------------------------------------------------------Epoch: 0----------------------------------------------------------------------

lr warmup...
Traceback (most recent call last):
File "train.py", line 285, in
train()
File "train.py", line 180, in train
for images, targets in data_loader: # load train data
File "/home/travism/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 345, in next
data = self._next_data()
File "/home/travism/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 856, in _next_data
return self._process_data(data)
File "/home/travism/anaconda3/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 881, in _process_data
data.reraise()
File "/home/travism/anaconda3/lib/python3.7/site-packages/torch/_utils.py", line 394, in reraise
raise self.exc_type(msg)
IndexError: Caught IndexError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/travism/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "/home/travism/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/travism/anaconda3/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/travism/python/SSD.Pytorch/data/voc0712.py", line 110, in getitem
im, gt, h, w = self.pull_item(index)
File "/home/travism/python/SSD.Pytorch/data/voc0712.py", line 129, in pull_item
img, boxes, labels = self.transform(img, target[:, :4], target[:, 4])
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Do you have any insights to the cause of this issue? Occasionally the code successfully performs 1 or 2 iterations, but consistently fails with this error.

Thanks so much!

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