aitorzip / PyTorch-SRGAN

A modern PyTorch implementation of SRGAN
https://arxiv.org/abs/1609.04802
GNU General Public License v3.0
361 stars 92 forks source link

Meet with error: KeyError: 'unexpected key "upsample2.conv.weight" in state_dict' #10

Open Andrew-Zhu opened 6 years ago

Andrew-Zhu commented 6 years ago

When I tried to use "./test --cuda", it can not work. And it prints " KeyError: 'unexpected key "upsample2.conv.weight" in state_dict'"

Can the code work?

penguin1214 commented 6 years ago

@Andrew-Zhu Hi, have you solved the problem? If so, could you share it? I ran in the same problem.

958099161 commented 6 years ago

hi,i have the problem as same as you.so how to resolve it

Bobholamovic commented 5 years ago

Hey bros, I met the same problem and when I set the upscale factor to 4 it turned out working.

sen-mao commented 5 years ago

I have the same problem when I use python3.7. When I change to use Anaconda3, I solve this problem, although I don't know why.

jerofad commented 5 years ago

I met this same issue and I did this generator.load_state_dict(torch.load(opt.generatorWeights), strict=False)

same for the discriminator