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

KeyError: 'opt_G' #32

Open
wmxlovextt opened this issue Mar 13, 2024 · 1 comment
Open

KeyError: 'opt_G' #32

wmxlovextt opened this issue Mar 13, 2024 · 1 comment

Comments

@wmxlovextt
Copy link

My problem is as follows, it does not load the weights of this model key.What should be done about it?

Traceback (most recent call last):
File "train.py", line 52, in
current_epoch, current_iteration = trainer.load_checkpoint(opt, args.which_iter)
File "/data/0_wmx/first_work_compare_experiment/compare_2/PIRender-main/trainers/base.py", line 234, in load_checkpoint
checkpoint_path, resume)
File "/data/0_wmx/first_work_compare_experiment/compare_2/PIRender-main/trainers/base.py", line 247, in _load_checkpoint
self.opt_G.load_state_dict(checkpoint['opt_G'])
KeyError: 'opt_G'
Traceback (most recent call last):
File "train.py", line 52, in
current_epoch, current_iteration = trainer.load_checkpoint(opt, args.which_iter)
File "/data/0_wmx/first_work_compare_experiment/compare_2/PIRender-main/trainers/base.py", line 234, in load_checkpoint
checkpoint_path, resume)
File "/data/0_wmx/first_work_compare_experiment/compare_2/PIRender-main/trainers/base.py", line 247, in _load_checkpoint
self.opt_G.load_state_dict(checkpoint['opt_G'])
KeyError: 'opt_G'
Traceback (most recent call last):
File "train.py", line 52, in
current_epoch, current_iteration = trainer.load_checkpoint(opt, args.which_iter)
File "/data/0_wmx/first_work_compare_experiment/compare_2/PIRender-main/trainers/base.py", line 234, in load_checkpoint
checkpoint_path, resume)
File "/data/0_wmx/first_work_compare_experiment/compare_2/PIRender-main/trainers/base.py", line 247, in _load_checkpoint
self.opt_G.load_state_dict(checkpoint['opt_G'])
KeyError: 'opt_G'
load [net_G] and [net_G_ema] from result/face/epoch_00190_iteration_000400000_checkpoint.pt
Traceback (most recent call last):
File "train.py", line 52, in
current_epoch, current_iteration = trainer.load_checkpoint(opt, args.which_iter)
File "/data/0_wmx/first_work_compare_experiment/compare_2/PIRender-main/trainers/base.py", line 234, in load_checkpoint
checkpoint_path, resume)
File "/data/0_wmx/first_work_compare_experiment/compare_2/PIRender-main/trainers/base.py", line 247, in _load_checkpoint
self.opt_G.load_state_dict(checkpoint['opt_G'])
KeyError: 'opt_G'
Traceback (most recent call last):
File "/home/dywgf/anaconda3/envs/pird/lib/python3.6/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/home/dywgf/anaconda3/envs/pird/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/dywgf/anaconda3/envs/pird/lib/python3.6/site-packages/torch/distributed/launch.py", line 260, in
main()
File "/home/dywgf/anaconda3/envs/pird/lib/python3.6/site-packages/torch/distributed/launch.py", line 256, in main
cmd=cmd)
subprocess.CalledProcessError: Command '['/home/dywgf/anaconda3/envs/pird/bin/python', '-u', 'train.py', '--local_rank=3', '--config', './config/face.yaml', '--name', 'face']' returned non-zero exit status 1.

@Leninchuka
Copy link

I also encountered this problem

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