bubbliiiing / yolov4-pytorch

这是一个YoloV4-pytorch的源码,可以用于训练自己的模型。
MIT License
2.1k stars 615 forks source link

RuntimeError: Error(s) in loading state_dict for YoloBody: #355

Closed xuwentai closed 1 year ago

xuwentai commented 1 year ago

B导求教:我可以训练,而且classes_path和model_path都改了,使用的voc权重进行训练,然后预测的时候使用了最后一次的权重,为什么还会报这个错误呀? RuntimeError: Error(s) in loading state_dict for YoloBody: size mismatch for yolo_head3.1.weight: copying a param with shape torch.Size([75, 256, 1, 1]) from checkpoint, the shape in current model is torch.Size([24, 256, 1, 1]). size mismatch for yolo_head3.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([24]). size mismatch for yolo_head2.1.weight: copying a param with shape torch.Size([75, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([24, 512, 1, 1]). size mismatch for yolo_head2.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([24]). size mismatch for yolo_head1.1.weight: copying a param with shape torch.Size([75, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([24, 1024, 1, 1]). size mismatch for yolo_head1.1.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([24]). 1 2 3 4 报错: 5