NTIRE-2018-Dehazing-Challenge icon indicating copy to clipboard operation
NTIRE-2018-Dehazing-Challenge copied to clipboard

RuntimeError: Error(s) in loading state_dict for Dense_rain_cvprw3

Open nicholasly opened this issue 6 years ago • 4 comments

I got back another running error as follows:

Traceback (most recent call last):
  File "dehazetest1.py", line 109, in <module>
    netG.load_state_dict(torch.load(opt.netG))
  File "/home/lyh/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict
    self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for Dense_rain_cvprw3:
	Missing key(s) in state_dict: "dense_block1.denselayer1.norm1.weight", ......

It seems that Dense_rain_cvprw3 in the file models/dehaze1113.py is not successfully loaded with the code netG=net.Dense_rain_cvprw3() in the file dehazetest.py

nicholasly avatar Aug 01 '18 07:08 nicholasly

Which version of pytorch are you using? I guess pytorch 0.3.1 should work well

hezhangsprinter avatar Aug 08 '18 02:08 hezhangsprinter

My pytorch version is 0.4.1, maybe some changes in this version caused this error while running your code.

nicholasly avatar Aug 09 '18 02:08 nicholasly

I encountered this problem too. My pytorch version is 0.3.1.

Traceback (most recent call last): File "dehazetest1.py", line 109, in netG.load_state_dict(torch.load(opt.netG)) File "/root/miniconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for Dense_rain_cvprw3: Missing key(s) in state_dict: "dense_block1.denselayer1.norm1.weight", "dense_block1.denselayer1.norm1.bias", ....

zhaoxin111 avatar Sep 30 '18 08:09 zhaoxin111

I am getting the same error as well, using pytorch 0.4.1. what should be done to solve it?

mojganmdd avatar Dec 10 '18 13:12 mojganmdd