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

A little bit confuse with KeyError: 'a' #47

Open
JulienFleuret opened this issue Nov 7, 2018 · 3 comments
Open

A little bit confuse with KeyError: 'a' #47

JulienFleuret opened this issue Nov 7, 2018 · 3 comments

Comments

@JulienFleuret
Copy link

Hello

I am trained MUNIT to make conversion of from 14 bit per pixel infrared data to colour images.
The training run without any particular issue.
Then I try to evaluate my model by tuning the test.py scripty but I encounter that message:

Traceback (most recent call last):
File "test.py", line 55, in
trainer.gen_a.load_state_dict(state_dict['a'])
KeyError: 'a'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "test.py", line 58, in
state_dict = pytorch03_to_pytorch04(torch.load(opts.checkpoint), opts.trainer)
File "/hdd1/prog/MUNIT/utils.py", line 372, in pytorch03_to_pytorch04
state_dict['a'] = __conversion_core(state_dict_base['a'], trainer_name)
KeyError: 'a'

If I well understand it does not find the weights ?
After the training I used the file "optimizer.pt" as model because I did not have a more explicit filename regarding the name of my dataset.

@xiang-zhe
Copy link

xiang-zhe commented Mar 4, 2019

hi, i got the problem too, when run the test.py file, did u fix it? @JSharp4273

Traceback (most recent call last):
File "test.py", line 55, in
trainer.gen_a.load_state_dict(state_dict['a'])
KeyError: 'a'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "test.py", line 58, in
state_dict = pytorch03_to_pytorch04(torch.load(opts.checkpoint), opts.trainer)
File "/home/xiang/git/MUNIT/utils.py", line 384, in pytorch03_to_pytorch04
state_dict['a'] = __conversion_core(state_dict_base['a'], trainer_name)
KeyError: 'a'

@xiang-zhe
Copy link

xiang-zhe commented Mar 4, 2019

if use gen_0****.pt, it's ok, but what's the dis_0****.pt and optimizer.pt,
"gen_a , auto-encoder for domain a" in trainer.py line17 that i could understand, but "dis_a, discriminator for domain a " in trainer.py line19 that i don't think i can understand, and more the model optimizer.pt just use to help training? and what do model dis_0***.pt for ?
just use the model gen_0***.pt when test ?
anyone can help me? thank you very much

@WanyiLi
Copy link

WanyiLi commented Dec 3, 2019

I meet the same problem too. I use the gen_*.pt when test.

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

3 participants