[solved] KeyError: 'unexpected key "module.encoder.embedding.weight" in state_dict'

just do this:

model = torch.load(train_model)

net.load_state_dict(model[‘state_dict’])

it works for me!