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

python benchmark.py -w pretrained/best.pth.tar: get RuntimeError: Unexpected key(s) in state_dict: "module.u_tex", "module.w_tex". #6

Closed
lhyfst opened this issue Nov 28, 2021 · 1 comment

Comments

@lhyfst
Copy link

lhyfst commented Nov 28, 2021

Hi, when I try to run python benchmark.py -w pretrained/best.pth.tar, I encounter such an error:

(SynergyNet) heyuan@VIML4:~/Research/3d_face/SynergyNet$ python benchmark.py -w pretrained/best.pth.tar
Traceback (most recent call last):
  File "benchmark.py", line 256, in <module>
    main()
  File "benchmark.py", line 252, in main
    benchmark(args.weights, args)
  File "benchmark.py", line 241, in benchmark
    aflw2000()
  File "benchmark.py", line 235, in aflw2000
    batch_size=128)
  File "benchmark.py", line 113, in extract_param
    model.load_state_dict(checkpoint)
  File "/home/heyuan/Environments/anaconda3/envs/deep3d_pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1045, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for DataParallel:
	Unexpected key(s) in state_dict: "module.u_tex", "module.w_tex". 

Do you have any idea to solve it?

@lhyfst
Copy link
Author

lhyfst commented Nov 28, 2021

I solve this problem by deleting "module.u_tex" and "module.w_tex" directly.

@lhyfst lhyfst closed this as completed Nov 28, 2021
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

1 participant