yolo3-pytorch icon indicating copy to clipboard operation
yolo3-pytorch copied to clipboard

把giou设置为False,训练出错,提示不匹配信息

Open JohnFiv opened this issue 2 years ago • 3 comments

JohnFiv avatar Mar 17 '22 01:03 JohnFiv

loss_x = torch.mean(self.BCELoss(x[obj_mask], y_true[..., 0][obj_mask]) * box_loss_scale) RuntimeError: The size of tensor a (5) must match the size of tensor b (13) at non-singleton dimension 3

JohnFiv avatar Mar 17 '22 01:03 JohnFiv

Traceback (most recent call last): File "D:\Pytorch_workspace\yolo3-pytorch-master_1\utils\utils_fit.py", line 42, in fit_one_epoch loss_item = yolo_loss(l, outputs[l], targets) File "D:\ProgramData\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 547, in call result = self.forward(*input, **kwargs) File "D:\Pytorch_workspace\yolo3-pytorch-master_1\nets\yolo_training.py", line 192, in forward loss_x = torch.mean(self.BCELoss(x[obj_mask], y_true[..., 0][obj_mask]) * box_loss_scale) RuntimeError: The size of tensor a (2) must match the size of tensor b (13) at non-singleton dimension 3

JohnFiv avatar Mar 17 '22 08:03 JohnFiv

box_loss_scale也要加个[obj_mask]

bubbliiiing avatar Mar 17 '22 14:03 bubbliiiing