-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing key(s) in state_dict while loading the pre-trained h36m model #9
Comments
Thanks for pointing this out. This is because we renamed the layer when cleaning the code for release. You could directly replace the "motion_transformer.transformer" with "motion_mlp.mlps" and it should be fine. |
I didn't manage to find |
You could either replace "motion_mlp" with "motion_transformer" in the code; or after loading the model, change the keys of the loaded model "motion_transformer" to "motion_mlp". |
If you please can also upload your pre-trained AMAAS model it will be kind of you, thanks in advance. |
I added a line to replace keys in state_dict and it worked. state_dict = {k.replace("motion_transformer.transformer", "motion_mlp.mlps"): v for k, v in state_dict.items()} Which is after line 108 in model = Model(config)
state_dict = torch.load(args.model_pth)
# line to add
state_dict = {k.replace("motion_transformer.transformer", "motion_mlp.mlps"): v for k, v in state_dict.items()}
model.load_state_dict(state_dict, strict=True)
model.eval()
model.cuda() |
but the reuslt is strang... |
Please see our latest update here, we upload our newly trained model using the exact same script of this repo. With the newly uploaded models, this issue is solved. |
Following the Readme about Evaluation:
python test.py --model-pth /home/user/git/siMLPe/checkpoints/h36m_model.pth
When loading the pre-trained model I get an error:
Missing key(s) in state_dict
Can you please tell me how can I solve that? thanks in advance.
The text was updated successfully, but these errors were encountered: