Rainyfish / FASRGAN-and-Fs-SRGAN

Fine-grained Attention and Feature-sharing Generative Adversarial Networksfor Single Image Super-Resolution
27 stars 6 forks source link

test_FsSRGAN.json error #3

Closed seungho-snu closed 1 year ago

seungho-snu commented 2 years ago

Hello, thank you for your great works. I was trying to run test_FsSRGAN.json and I got an error related to the part below.

self.netE = networks.define_E(opt).to(self.device) #ex

File "E:\exp\ref\FASRGAN-and-Fs-SRGAN-master\FASRGAN_and_Fs-SRGAN\codes\models\networks.py", line 153, in define_E raise NotImplementedError('Discriminator model [{:s}] not recognized'.format(which_model)) TypeError: unsupported format string passed to NoneType.format

I found the code below. networks.py, 138 line which_model = opt_net['which_model_ex']

It seems that there is no 'which_model_ex' in test_FsSRGAN.json file.

I have modified it as below. which_model = opt_net['which_model_ex'] -> which_model = opt_net['which_model_G']

Then I encountered another error...It seems that there is some problem with the pretrained network E.

RuntimeError: Error(s) in loading state_dict for model_ex: Missing key(s) in state_dict: "model.1.sub.RDB1.conv1.0.weight", "model.1.sub.RDB1.conv1.0.bias", "model.1.sub.RDB1.conv2.0.weight", "model.1.sub.RDB1.conv2.0.bias", "model.1.sub.RDB1.conv3.0.weight", "model.1.sub.RDB1.conv3.0.bias", "model.1.sub.RDB1.conv4.0.weight", "model.1.sub.RDB1.conv4.0.bias", "model.1.sub.RDB1.conv5.0.weight", "model.1.sub.RDB1.conv5.0.bias", "model.1.sub.RDB2.conv1.0.weight", "model.1.sub.RDB2.conv1.0.bias", "model.1.sub.RDB2.conv2.0.weight", "model.1.sub.RDB2.conv2.0.bias", "model.1.sub.RDB2.conv3.0.weight", "model.1.sub.RDB2.conv3.0.bias", "model.1.sub.RDB2.conv4.0.weight", "model.1.sub.RDB2.conv4.0.bias", "model.1.sub.RDB2.conv5.0.weight", "model.1.sub.RDB2.conv5.0.bias", "model.1.sub.RDB3.conv1.0.weight", "model.1.sub.RDB3.conv1.0.bias", "model.1.sub.RDB3.conv2.0.weight", "model.1.sub.RDB3.conv2.0.bias", "model.1.sub.RDB3.conv3.0.weight", "model.1.sub.RDB3.conv3.0.bias", "model.1.sub.RDB3.conv4.0.weight", "model.1.sub.RDB3.conv4.0.bias", "model.1.sub.RDB3.conv5.0.weight", "model.1.sub.RDB3.conv5.0.bias". Unexpected key(s) in state_dict: "model.1.sub.0.RDB1.conv1.0.weight", "model.1.sub.0.RDB1.conv1.0.bias", "model.1.sub.0.RDB1.conv2.0.weight", "model.1.sub.0.RDB1.conv2.0.bias",

Could you fix this error?

seungho-snu commented 1 year ago

Thank you for your interest. I will check and fix codes within a few days. Thank you again.

seungho-snu commented 1 year ago

I fixed and updated the codes. Sorry for errors.