Skip to content
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

Raise error in eval_single_pair.py after running train.py in motion retargeting. #28

Closed
ANYMS-A opened this issue Jun 10, 2020 · 2 comments

Comments

@ANYMS-A
Copy link

ANYMS-A commented Jun 10, 2020

Hi, I customized a TrainDataset and tried to use this dataset to train the motion retargeting model from scratch. However, after run the train.py(it even isn't been run successfully ), then when I run the demo.py or eval_single_pair.py it throw our errors like below:
**
loading from ./pretrained/models/topology0
loading from epoch 20000......
Traceback (most recent call last):
File "/home/deep-motion-editing-new/home/deep-motion-editing-new/retargeting/eval_single_pair.py", line 98, in
main()
File "/home/deep-motion-editing-new/home/deep-motion-editing-new/retargeting/eval_single_pair.py", line 78, in main
model.load(epoch=20000)
File "/home/deep-motion-editing-new/home/deep-motion-editing-new/retargeting/models/architecture.py", line 274, in load
model.load(os.path.join(self.model_save_dir, 'topology{}'.format(i)), epoch)
File "/home/deep-motion-editing-new/home/deep-motion-editing-new/retargeting/models/integrated.py", line 83, in load
map_location=self.args.cuda_device))
File "/home/hair_gans/venv/lib/python3.6/site-packages/torch/nn/modules/module.py", line 847, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for AE:
Missing key(s) in state_dict: "enc.layers.2.0.mask", "enc.layers.2.0.weight", "enc.layers.2.0.bias", "enc.layers.2.0.offset_enc.bias", "enc.layers.2.0.offset_enc.weight", "enc.layers.2.0.offset_enc.mask", "enc.layers.2.1.weight", "dec.layers.2.1.weight", "dec.layers.2.2.mask", "dec.layers.2.2.weight", "dec.layers.2.2.bias", "dec.layers.2.2.offset_enc.bias", "dec.layers.2.2.offset_enc.weight", "dec.layers.2.2.offset_enc.mask", "dec.unpools.2.weight", "dec.enc.layers.2.0.mask", "dec.enc.layers.2.0.weight", "dec.enc.layers.2.0.bias", "dec.enc.layers.2.0.offset_enc.bias", "dec.enc.layers.2.0.offset_enc.weight", "dec.enc.layers.2.0.offset_enc.mask", "dec.enc.layers.2.1.weight".
Unexpected key(s) in state_dict: "dec.layers.1.2.bias".
size mismatch for dec.layers.0.1.weight: copying a param with shape torch.Size([192, 112]) from checkpoint, the shape in current model is torch.Size([224, 224]).
size mismatch for dec.layers.0.2.mask: copying a param with shape torch.Size([96, 192, 15]) from checkpoint, the shape in current model is torch.Size([112, 224, 15]).
size mismatch for dec.layers.0.2.weight: copying a param with shape torch.Size([96, 192, 15]) from checkpoint, the shape in current model is torch.Size([112, 224, 15]).
size mismatch for dec.layers.0.2.bias: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([112]).
size mismatch for dec.layers.0.2.offset_enc.bias: copying a param with shape torch.Size([96]) from checkpoint, the shape in current model is torch.Size([112]).
size mismatch for dec.layers.0.2.offset_enc.weight: copying a param with shape torch.Size([96, 72]) from checkpoint, the shape in current model is torch.Size([112, 84]).
size mismatch for dec.layers.0.2.offset_enc.mask: copying a param with shape torch.Size([96, 72]) from checkpoint, the shape in current model is torch.Size([112, 84]).
size mismatch for dec.layers.1.1.weight: copying a param with shape torch.Size([184, 96]) from checkpoint, the shape in current model is torch.Size([192, 112]).
size mismatch for dec.layers.1.2.mask: copying a param with shape torch.Size([92, 184, 15]) from checkpoint, the shape in current model is torch.Size([96, 192, 15]).
size mismatch for dec.layers.1.2.weight: copying a param with shape torch.Size([92, 184, 15]) from checkpoint, the shape in current model is torch.Size([96, 192, 15]).
size mismatch for dec.layers.1.2.offset_enc.bias: copying a param with shape torch.Size([92]) from checkpoint, the shape in current model is torch.Size([96]).
size mismatch for dec.layers.1.2.offset_enc.weight: copying a param with shape torch.Size([92, 69]) from checkpoint, the shape in current model is torch.Size([96, 72]).
size mismatch for dec.layers.1.2.offset_enc.mask: copying a param with shape torch.Size([92, 69]) from checkpoint, the shape in current model is torch.Size([96, 72]).
size mismatch for dec.unpools.0.weight: copying a param with shape torch.Size([192, 112]) from checkpoint, the shape in current model is torch.Size([224, 224]).
size mismatch for dec.unpools.1.weight: copying a param with shape torch.Size([184, 96]) from checkpoint, the shape in current model is torch.Size([192, 112]).

Process finished with exit code 1
**

Even I use version control tools roll back the code, it stills raise this error!
Have you ever met this before?
Many thanks!

@PeizhuoLi
Copy link
Collaborator

More instruction regarding how to train the network will be released latter. The model is created based on the input bvh files at test time, then load the pre-trained weights from files. This could come from your customized dataset, which might have different topology from the Mixamo dataset and lead to different numbers of channels. Hope this would help.

@ANYMS-A
Copy link
Author

ANYMS-A commented Jun 10, 2020

More instruction regarding how to train the network will be released latter. The model is created based on the input bvh files at test time, then load the pre-trained weights from files. This could come from your customized dataset, which might have different topology from the Mixamo dataset and lead to different numbers of channels. Hope this would help.

Thanks you so much! I've solve this bug, yes you're right, the train process updated the para.txt file and leads to this problem.

@ANYMS-A ANYMS-A closed this as completed Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants