Two model：Net_D，Net_C
Net_D
class Net_D(nn.Module):
    def __init__(self):
        super(Net_D, self).__init__()

        model = models.resnet50(pretrained=False)
        model.fc = nn.Linear(hidden_dim, num_D_class)
        model = remove_last(model)
        self.resnet = model
........

class Net_C(nn.Module):
def init(self):
super(Net_C, self).init()
    model = self.load_state_dict(torch.load("best.mdl")
    model.fc = nn.Linear(hidden_dim, num_C_class)
    model = remove_last(model)

    self.resnet = model

…

Two training code: train_D.py, train_C.py
part code for train_D.py
 torch.save(model.state_dict(), 'best.mdl')

part code for train_C.py
    model = Net_C()
    model.to(device)
    print('Model is built ...')
。。。。。。

I run the train_D.py successfuly and I got the best.mdl file.
But when I try to run train_C.py to pretrain the best model, I got the following error info:
RuntimeError: Error(s) in loading state_dict for Fusion_Net_C:
	Unexpected key(s) in state_dict: "resnet.0.weight", "resnet.1.weight", "resnet.1.bias",......
But I found there are actually such keys above.
Any help, thanks.