tianzhi0549 / FCOS

FCOS: Fully Convolutional One-Stage Object Detection (ICCV'19)
https://arxiv.org/abs/1904.01355
Other
3.28k stars 630 forks source link

confused error about training resnet_101 and resnet_50 #146

Closed dreamhighchina closed 5 years ago

dreamhighchina commented 5 years ago

when i train resnet_101, everything is ok,but when i train resnet_50(dont have R-50.pkl) ,encounter follow proplem:

RuntimeError: Error(s) in loading state_dict for GeneralizedRCNN: size mismatch for rpn.head.cls_logits.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([15]). size mismatch for rpn.head.cls_logits.weight: copying a param with shape torch.Size([80, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([15, 256, 1, 1]). size mismatch for rpn.head.bbox_pred.bias: copying a param with shape torch.Size([4]) from checkpoint, the shape in current model is torch.Size([60]). size mismatch for rpn.head.bbox_pred.weight: copying a param with shape torch.Size([4, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([60, 256, 1, 1]).

according to your suggestion (python setup.py build develop)at issue #92 ,the problem has been solved,but another error has appeared like issues #65 , The difinite description is below: RuntimeError: Error(s) in loading state_dict for GeneralizedRCNN: size mismatch for rpn.head.cls_logits.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([15]). size mismatch for rpn.head.cls_logits.weight: copying a param with shape torch.Size([80, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([15, 256, 1, 1]). size mismatch for rpn.head.bbox_pred.bias: copying a param with shape torch.Size([4]) from checkpoint, the shape in current model is torch.Size([60]). size mismatch for rpn.head.bbox_pred.weight: copying a param with shape torch.Size([4, 256, 3, 3]) from checkpoint, the shape in current model is torch.Size([60, 256, 1, 1]).

tianzhi0549 commented 5 years ago

@dreamhighchina please remove these keys in the saved models with incompatible shape.

dreamhighchina commented 5 years ago

ok,i will have a try,thanks!