-
Notifications
You must be signed in to change notification settings - Fork 200
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: 'unexpected key "module.conv1_1.weight" in state_dict' #30
Comments
Fix : In models/base_model.py replace the load_network with the following: def load_network(self, network, network_label, epoch_label): |
您好,在经过上述修改后, |
Is your python 3.5, pytorch 0.3.1? And are you trying to run via CPU or GPU? |
@Dear-Mr @SreeHarshaNelaturu Eg.
|
I've pushed a new version. You can directly pull the new version to avoid this problem. |
Thanks for your reply. |
Traceback (most recent call last):
File "predict.py", line 18, in
model = create_model(opt)
File "/home/Documents//enlighten/EnlightenGAN/models/models.py", line 36, in create_model
model.initialize(opt)
File "/home/Documents/enlighten/EnlightenGAN/models/single_model.py", line 72, in initialize
self.load_network(self.netG_A, 'G_A', which_epoch)
File "/home/Documents/enlighten/EnlightenGAN/models/base_model.py", line 53, in load_network
network.load_state_dict(torch.load(save_path))
File "/home/anaconda3/envs/enlighten/lib/python3.5/site-packages/torch/nn/modules/module.py", line 522, in load_state_dict
.format(name))
KeyError: 'unexpected key "module.conv1_1.weight" in state_dict'
Python: 3.5.6
PyTorch : 0.3.1
CPU
I'm facing this error when I run the test command in script/scripts.py, I would appreciate any help!
Thank you in advance!
The text was updated successfully, but these errors were encountered: