I solved it.
premodel = torch.load(‘pre.pth’)
new_model_dict = newmodel.state_dict()for k, v in premodel:
new_model_dict [k] = vnewmodel.load_state_dict(new_model_dict)
I solved it.
premodel = torch.load(‘pre.pth’)
new_model_dict = newmodel.state_dict()for k, v in premodel:
new_model_dict [k] = vnewmodel.load_state_dict(new_model_dict)