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.
(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
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.
Downgrading numpy solved the issue for me
pip install numpy==1.21.6
did you solve this?
@jingchengQF @sonukiller I am facing the same issue. How did you solve this problem?
Found the solution. https://github.com/amdegroot/ssd.pytorch/issues/587