BobLiu20 / YOLOv3_PyTorch

Full implementation of YOLOv3 in PyTorch
624 stars 191 forks source link

Training error: RuntimeError: invalid argument 2: size '[1 x 3 x 6 x 13 x 13]' is invalid for input with 43095 elements at /pytorch/aten/src/TH/THStorage.c:41 #1

Closed nszceta closed 6 years ago

nszceta commented 6 years ago
Traceback (most recent call last):
  File "training.py", line 224, in <module>
    main()
  File "training.py", line 221, in main
    train(config)
  File "training.py", line 93, in train
    _loss_item = yolo_losses[i](outputs[i], labels)
  File "/home/adam/.virtualenvs/yolov3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/adam/yolov3/YOLOv3_PyTorch/training/../nets/yolo_loss.py", line 33, in forward
    self.bbox_attrs, in_h, in_w).permute(0, 1, 3, 4, 2).contiguous()
RuntimeError: invalid argument 2: size '[1 x 3 x 6 x 13 x 13]' is invalid for input with 43095 elements at /pytorch/aten/src/TH/THStorage.c:41
# prediction = input.view(bs,  self.num_anchors, self.bbox_attrs, in_h, in_w).permute(0, 1, 3, 4, 2).contiguous()
ipdb> input.size()
torch.Size([1, 255, 13, 13])
ipdb> bs, in_h, in_w, self.num_anchors, self.bbox_attrs
(1, 13, 13, 3, 6)
ipdb> self.num_classes
1
BobLiu20 commented 6 years ago

@nszceta Hi. Thanks for your bug report. This issue had beed fixed now. See commit dd888e and 28fdf61 Run git pull to continue your training.