You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
#589
Open
jingchengQF opened this issue
May 16, 2023
· 4 comments
(yolo) E:\download\anaconda\envs\ssd.pytorch-master>python train.py
E:\download\anaconda\envs\ssd.pytorch-master\ssd.py:34: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead.
self.priors = Variable(self.priorbox.forward(), volatile=True)
Loading base network...
Initializing weights...
E:\download\anaconda\envs\ssd.pytorch-master\train.py:218: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
init.xavier_uniform(param)
Loading the dataset...
Training SSD on: VOC0712
Using the specified args:
Namespace(dataset='VOC', dataset_root='E:/download/anaconda/envs/ssd.pytorch-master/data/VOCdevkit/', basenet='vgg16_reducedfc.pth', batch_size=32, resume=None, start_iter=0, num_workers=4, cuda=True, lr=0.001, momentum=0.9, weight_decay=0.0005, gamma=0.1, visdom=False, save_folder='weights/')
Traceback (most recent call last):
File "E:\download\anaconda\envs\ssd.pytorch-master\train.py", line 259, in
train()
File "E:\download\anaconda\envs\ssd.pytorch-master\train.py", line 169, in train
images, targets = next(batch_iterator)
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data\dataloader.py", line 633, in next
data = self._next_data()
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data\dataloader.py", line 1345, in _next_data
return self._process_data(data)
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data\dataloader.py", line 1371, in _process_data
data.reraise()
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch_utils.py", line 644, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\download\anaconda\envs\ssd.pytorch-master\data\voc0712.py", line 115, in getitem
im, gt, h, w = self.pull_item(index)
File "E:\download\anaconda\envs\ssd.pytorch-master\data\voc0712.py", line 134, in pull_item
img, boxes, labels = self.transform(img, target[:, :4], target[:, 4])
File "E:\download\anaconda\envs\ssd.pytorch-master\utils\augmentations.py", line 417, in call
return self.augment(img, boxes, labels)
File "E:\download\anaconda\envs\ssd.pytorch-master\utils\augmentations.py", line 52, in call
img, boxes, labels = t(img, boxes, labels)
File "E:\download\anaconda\envs\ssd.pytorch-master\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.
for all the code ,I change three place
one and two is the way of file
COCO_ROOT = osp.join('E:/download/anaconda/envs/ssd.pytorch-master/data/coco/') in coco.py
VOC_ROOT = osp.join("E:/download/anaconda/envs/ssd.pytorch-master/data/VOCdevkit/") in VOC0721.py
three is in train.py for the error (RuntimeError: Expected a 'cuda' device type for generator but found 'cpu')
# data_loader = data.DataLoader(dataset, args.batch_size,
# num_workers=args.num_workers,
# shuffle=True, collate_fn=detection_collate,
# pin_memory=True)
data_loader = data.DataLoader(dataset, args.batch_size,
num_workers=args.num_workers,
shuffle=True, collate_fn=detection_collate,
pin_memory=True, generator=torch.Generator(device='cuda'))
that's all.I think I didn't change any parameter.
The text was updated successfully, but these errors were encountered:
(yolo) E:\download\anaconda\envs\ssd.pytorch-master>python train.py
E:\download\anaconda\envs\ssd.pytorch-master\ssd.py:34: UserWarning: volatile was removed and now has no effect. Use
with torch.no_grad():
instead.self.priors = Variable(self.priorbox.forward(), volatile=True)
Loading base network...
Initializing weights...
E:\download\anaconda\envs\ssd.pytorch-master\train.py:218: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform_.
init.xavier_uniform(param)
Loading the dataset...
Training SSD on: VOC0712
Using the specified args:
Namespace(dataset='VOC', dataset_root='E:/download/anaconda/envs/ssd.pytorch-master/data/VOCdevkit/', basenet='vgg16_reducedfc.pth', batch_size=32, resume=None, start_iter=0, num_workers=4, cuda=True, lr=0.001, momentum=0.9, weight_decay=0.0005, gamma=0.1, visdom=False, save_folder='weights/')
Traceback (most recent call last):
File "E:\download\anaconda\envs\ssd.pytorch-master\train.py", line 259, in
train()
File "E:\download\anaconda\envs\ssd.pytorch-master\train.py", line 169, in train
images, targets = next(batch_iterator)
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data\dataloader.py", line 633, in next
data = self._next_data()
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data\dataloader.py", line 1345, in _next_data
return self._process_data(data)
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data\dataloader.py", line 1371, in _process_data
data.reraise()
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch_utils.py", line 644, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data_utils\worker.py", line 308, in _worker_loop
data = fetcher.fetch(index)
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\download\anaconda\envs\yolo\lib\site-packages\torch\utils\data_utils\fetch.py", line 51, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\download\anaconda\envs\ssd.pytorch-master\data\voc0712.py", line 115, in getitem
im, gt, h, w = self.pull_item(index)
File "E:\download\anaconda\envs\ssd.pytorch-master\data\voc0712.py", line 134, in pull_item
img, boxes, labels = self.transform(img, target[:, :4], target[:, 4])
File "E:\download\anaconda\envs\ssd.pytorch-master\utils\augmentations.py", line 417, in call
return self.augment(img, boxes, labels)
File "E:\download\anaconda\envs\ssd.pytorch-master\utils\augmentations.py", line 52, in call
img, boxes, labels = t(img, boxes, labels)
File "E:\download\anaconda\envs\ssd.pytorch-master\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.
for all the code ,I change three place
one and two is the way of file
COCO_ROOT = osp.join('E:/download/anaconda/envs/ssd.pytorch-master/data/coco/') in coco.py
VOC_ROOT = osp.join("E:/download/anaconda/envs/ssd.pytorch-master/data/VOCdevkit/") in VOC0721.py
three is in train.py for the error (RuntimeError: Expected a 'cuda' device type for generator but found 'cpu')
# data_loader = data.DataLoader(dataset, args.batch_size,
# num_workers=args.num_workers,
# shuffle=True, collate_fn=detection_collate,
# pin_memory=True)
data_loader = data.DataLoader(dataset, args.batch_size,
num_workers=args.num_workers,
shuffle=True, collate_fn=detection_collate,
pin_memory=True, generator=torch.Generator(device='cuda'))
that's all.I think I didn't change any parameter.
The text was updated successfully, but these errors were encountered: