How to solve the problem that "unexpected key"

I want to load a model,I need the latest_net_G_A.pth ,when I load the file ,an error appeared,it is the 'unexpected key “model.10.conv_block.5.weight” in state_dict’

Do you have an instance of a model with the exact same structure as the model you saved?

How do you save/load the model?

I saved the .pth file during the training process,then I load the model by the way as follows 2018-07-31%2014-56-03%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE

Did you save only the statedict or the entire model?

If you saved only the statedict you need to do something like

model = MyModel() # create instance of your model with exact same structure as the one you saved
model.load_state_dict(torch.load("/your/path/to/statedict.pth"

To check whether you saved the statedict or the entire model we need to see your saving code.

yes ,I have checked my code .Isaved the statedict rather than the entire model.thank you for you reply!