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
Hi @wcwang07 , "CocoDetection" returns "image" and "targets" instead of "image", "boxes", "labels". You can split "targets" into "boxes" and "labels" to make it work. Plz see "coco.loadAnns" to get the format of "targets".
has anyone ran into issue training on CocoDataset , I have modified on line 220:
elif args.dataset_type == 'coco':
221 # Image preprocessing, normalization for the pretrained resnet
222 transform = transforms.Compose([
223 transforms.RandomCrop(224),
224 transforms.RandomHorizontalFlip(),
225 transforms.ToTensor(),
226 transforms.Normalize((0.485, 0.456, 0.406),
227 (0.229, 0.224, 0.225))])
228 # Load vocabulary wrapper
229 with open('/home/ubuntu/data/coco/vocab.pkl', 'rb') as f:
230 vocab = pickle.load(f)
231 dataset = CocoDataset(dataset_path, json='/home/ubuntu/data/coco/annotations/captions_train2014.json', vocab=vocab,transform=transform)
232 label_file = '/home/ubuntu/data/coco-labels-file.txt'
when i tried to run
337 train(train_loader, net, criterion, optimizer,
338 device=DEVICE, debug_steps=args.debug_steps, epoch=epoch)
got the elements mistach
File "train_ssd.py", line 121, in train
images, boxes, labels = data
ValueError: not enough values to unpack (expected 3, got 2)
tensor data[0] has shape (1,3,224,224)
tensor data[1] has shape (1,15)
i think we are missing data[2]
Any insight is helpful, thank you in advance.
The text was updated successfully, but these errors were encountered: