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

Error while training #281

Open
Saif0765 opened this issue Aug 20, 2022 · 1 comment
Open

Error while training #281

Saif0765 opened this issue Aug 20, 2022 · 1 comment

Comments

@Saif0765
Copy link

/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/transforms/transforms.py:383: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
mode = random.choice(self.sample_options)
Traceback (most recent call last):
File "train.py", line 358, in
device=DEVICE, debug_steps=args.debug_steps, epoch=epoch)
File "train.py", line 136, in train
for i, data in enumerate(loader):
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 681, in next
data = self._next_data()
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1376, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py", line 1402, in _process_data
data.reraise()
File "/usr/local/lib/python3.7/dist-packages/torch/_utils.py", line 461, in reraise
raise exception
IndexError: Caught IndexError 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 302, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/_utils/fetch.py", line 49, 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 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataset.py", line 235, in getitem
return self.datasets[dataset_idx][sample_idx]
File "/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/datasets/voc_dataset.py", line 61, in getitem
image, boxes, labels = self.transform(image, boxes, labels)
File "/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/ssd/data_preprocessing.py", line 33, in call
return self.augment(img, boxes, labels)
File "/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/transforms/transforms.py", line 75, in call
img, boxes, labels = t(img, boxes, labels)
File "/content/Ultra-Light-Fast-Generic-Face-Detector-1MB/vision/transforms/transforms.py", line 129, in call
boxes[:, 0] /= width
IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

@lukseny
Copy link

lukseny commented Oct 26, 2022

I faced the same problem
It turned out that there was error in annotation preparation
In annotations I had [X, Y] classes, so I was training model for class [X] while my xml_s had examples of images with only class [Y], so boxes land labels had and empty list
Annotation revision and cleaning worked for me

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

2 participants