Thank you, I tried it. This problem has been bothering me for a long time.Since I was fine-tuning the pre-training model and saving it, I still got the following error:
self.class.name, “\n\t”.join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for ResNet:
While copying the parameter named “fc.weight”, whose dimensions in the model are torch.Size([1000, 2048]) and whose dimensions in the checkpoint are torch.Size([11, 2048]).
While copying the parameter named “fc.bias”, whose dimensions in the model are torch.Size([1000]) and whose dimensions in the checkpoint are torch.Size([11]).