具体错误日志如下:
The resulting error log is as follows Traceback (most recent call last): File "train.py", line 441, in <module> train() # train normally File "train.py", line 324, in train dataloader=testloader) File "F:\train\yolov3hat\test.py", line 85, in test inf_out, train_out = model(imgs) # inference and training outputs File "D:\Program Files\Python\Python37\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__ result = self.forward(*input, **kwargs) File "F:\train\yolov3hat\models.py", line 260, in forward return torch.cat(io, 1), p RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1. Got 7 and 85 in dimension 2 at C:/w/1/s/windows/pytorch/aten/src\THC/generic/THCTensorMath.cu:71
解决办法:
本次我提出的问题:
你应该检查你的 yolov3的配置文件中 全连接层的配置情况
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 1 #805
原文:https://www.cnblogs.com/dgwblog/p/12232741.html