pytorch 训练时错误size mismatch for module_list.88.Conv2d.weight: copying a param with shape torch.Size

size mismatch for module_list.88.Conv2d.weight: copying a param with shape torch.Size([75, 1024, 1, 1]) from checkpoint, the shape in current model is torch.Size([255, 1024, 1, 1]).
size mismatch for module_list.88.Conv2d.bias: copying a param with shape torch.Size([75]) from checkpoint, the shape in current model is torch.Size([255]).

出现的错误,与解决方法
模型文件与模型配置文件不一致。比如长宽,输出的类别个数等等。使用模型时,一定要使用相应的参数。

猜你喜欢

转载自blog.csdn.net/WANGYONGZIXUE/article/details/119192563