targets.append(torch.FloatTensor(sample[1])) RuntimeError: given sequence has an invalid size of dimension 2: 0

Traceback (most recent call last):
File "/home/user/Disk1.8T/unicoe/pytorch-ssd/experments/12_13/train_resnet640_480.py", line 282, in <module>
train()
File "/home/user/Disk1.8T/unicoe/pytorch-ssd/experments/12_13/train_resnet640_480.py", line 206, in train
images, targets = next(batch_iterator)
File "/home/user/anaconda3/envs/pytorch_ssd/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 286, in __next__
return self._process_next_batch(batch)
File "/home/user/anaconda3/envs/pytorch_ssd/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 306, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File "/home/user/anaconda3/envs/pytorch_ssd/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 58, in _worker_loop
samples = collate_fn([dataset[i]])
File "/home/user/Disk1.8T/unicoe/pytorch-ssd/data/voc0712.py", line 224, in detection_collate
targets.append(torch.FloatTensor(sample[1]))
RuntimeError: given sequence has an invalid size of dimension 2: 0

  

这个问题有点摸不着头脑

猜你喜欢

转载自www.cnblogs.com/ya-cpp/p/10116234.html