|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
Traceback (most recent call last):
File "F:/faster-rcnn-pytorch-master/predict.py", line 14, in <module>
frcnn = FRCNN()
File "F:\faster-rcnn-pytorch-master\frcnn.py", line 88, in __init__
self.generate()
File "F:\faster-rcnn-pytorch-master\frcnn.py", line 99, in generate
self.net.load_state_dict(torch.load(self.model_path, map_location=device),False)
File "E:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1224, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for FasterRCNN:
size mismatch for head.cls_loc.weight: copying a param with shape torch.Size([84, 2048]) from checkpoint, the shape in current model is torch.Size([20, 2048]).
size mismatch for head.cls_loc.bias: copying a param with shape torch.Size([84]) from checkpoint, the shape in current model is torch.Size([20]).
size mismatch for head.score.weight: copying a param with shape torch.Size([21, 2048]) from checkpoint, the shape in current model is torch.Size([5, 2048]).
size mismatch for head.score.bias: copying a param with shape torch.Size([21]) from checkpoint, the shape in current model is torch.Size([5]).
训练faster-r-cnn模型出现这样的问题,有大佬知道这是为什么吗? |
|