问题描述
题主主要是在pytorch上跑yolov3 时出现如下问题,经过一次次的bug,各种百度,各种调试之后,写下此博客,希望能有所帮助。才疏学浅,欢迎批评指正
出现的错误主要如下
RuntimeError: Error(s) in loading state_dict for YoloBody:
size mismatch for last_layer0.6.weight: copying a param with shape torch.Size(【255, 1024, 1, 1】) from checkpoint, the shape in current model is torch.Size(【18, 1024, 1, 1】).
size mismatch for last_layer0.6.bias: copying a param with shape torch.Size(【255】) from checkpoint, the shape in current model is torch.Size(【18】).
size mismatch for last_layer1.6.weight: copying a param with shape torch.Size(【255, 512, 1, 1】) from checkpoint, the shape in current model is torch.Size(【18, 512, 1, 1】).
size mismatch for last_layer1.6.bias: copying a param with shape torch.Size(【255】) from checkpoint, the shape in current model is torch.Size(【18】).
size mismatch for last_layer2.6.weight: copying a param with