Yolo_Nano icon indicating copy to clipboard operation
Yolo_Nano copied to clipboard

RuntimeError: The size of tensor a (3) must match the size of tensor b (9) at non-singleton dimension 1

Open lvrui-code opened this issue 2 years ago • 1 comments

Traceback (most recent call last): File "/media/omnisky/data/lr/Yolo_Nano2/train.py", line 140, in loss, outputs = model(imgs,targets=targets,img_scores=img_scores,gt_mix_index = gt_mix_index) File "/home/omnisky/anaconda3/envs/wujingyu/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/media/omnisky/data/lr/Yolo_Nano2/models/yolo_nano_helper.py", line 239, in forward layer_0_x, layer_loss = self.yolo0(x_scale_1,targets,img_dim,img_scores = img_scores,gt_mix_index=gt_mix_index) File "/home/omnisky/anaconda3/envs/wujingyu/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/media/omnisky/data/lr/Yolo_Nano2/models/darknet.py", line 241, in forward loss_cls_1 = torch.mean(self.bce_loss(pred_cls[obj_mask_1], tcls[obj_mask_1])*sum_weights1[obj_mask_1]) RuntimeError: The size of tensor a (3) must match the size of tensor b (9) at non-singleton dimension 1

Just replaced the coco format dataset made by yourself. What's the reason?

lvrui-code avatar Dec 15 '21 01:12 lvrui-code