加载训练的模型报如下错误。
>>> model.load_state_dict(torch.load(model_path))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 777, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for CRNN:
Missing key(s) in state_dict: "cnn.conv0.bias", "cnn.conv0.weight", "cnn.conv1.bias", "cnn.conv1.weight", "cnn.conv2.bias", "cnn.conv2.weight", "cnn.batchnorm2.running_var", "cnn.batchnorm2.bias", "cnn.batchnorm2.weight", "cnn.batchnorm2.running_mean", "cnn.conv3.bias", "cnn.conv3.weight", "cnn.conv4.bias", "cnn.conv4.weight", "cnn.batchnorm4.running_var", "cnn.batchnorm4.bias", "cnn.batchnorm4.weight", "cnn.batchnorm4.running_