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

Data Loader error #1

Open
erivera1802 opened this issue Jun 21, 2023 · 1 comment
Open

Data Loader error #1

erivera1802 opened this issue Jun 21, 2023 · 1 comment

Comments

@erivera1802
Copy link

erivera1802 commented Jun 21, 2023

Hi,
Im trying to run the code with the COCO dataset, but I get an error when trying to extract the images from the data loader, specifically:

`
Loading the dataset...
Training SSD on: MS COCO
Using the specified args:
Loading the backbone pretrained in Imagenet...
0
Traceback (most recent call last):
File "/home/esteban/Promotion/ComputerVision/AL-SSL/train.py", line 255, in train
images, targets, semis = next(batch_iterator)
File "/home/esteban/anaconda3/envs/ki/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 634, in next
data = self._next_data()
File "/home/esteban/anaconda3/envs/ki/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1326, in _next_data
return self._process_data(data)
File "/home/esteban/anaconda3/envs/ki/lib/python3.10/site-packages/torch/utils/data/dataloader.py", line 1372, in _process_data
data.reraise()
File "/home/esteban/anaconda3/envs/ki/lib/python3.10/site-packages/torch/_utils.py", line 644, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 1.
Original Traceback (most recent call last):
File "/home/esteban/anaconda3/envs/ki/lib/python3.10/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "/home/esteban/anaconda3/envs/ki/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/esteban/anaconda3/envs/ki/lib/python3.10/site-packages/torch/utils/data/_utils/fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/esteban/Promotion/ComputerVision/AL-SSL/data/coco.py", line 132, in getitem
im, gt, h, w, semi = self.pull_item(index)
File "/home/esteban/Promotion/ComputerVision/AL-SSL/data/coco.py", line 171, in pull_item
img, boxes, labels = self.transform(img, target[:, :4],
File "/home/esteban/Promotion/ComputerVision/AL-SSL/utils/augmentations.py", line 425, in call
return self.augment(img, boxes, labels)
File "/home/esteban/Promotion/ComputerVision/AL-SSL/utils/augmentations.py", line 52, in call
img, boxes, labels = t(img, boxes, labels)
File "/home/esteban/Promotion/ComputerVision/AL-SSL/utils/augmentations.py", line 238, in call
mode = random.choice(self.sample_options)
File "mtrand.pyx", line 920, in numpy.random.mtrand.RandomState.choice
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (6,) + inhomogeneous part.

`

I have only changed the paths of the datasets, but somehow this error appears, do you know what It could be?

@bharanibala
Copy link

bharanibala commented May 20, 2024

Hi,

I am also facing the same issue but I am using a custom dataset. Did you solve this issue? If so, Could you please help me?

Thanks,
Bharaneeshwar.

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