KAIR icon indicating copy to clipboard operation
KAIR copied to clipboard

main_test_rrdb.py

Open House-Leo opened this issue 3 years ago • 3 comments

用main_train_rrdb_psnr.py训练出model之后,用test代码不能正常超分图片。 用原model = net(in_nc=3, out_nc=3, nc=64, nb=23, gc=32, upscale=4, act_mode='L', upsample_mode='upconv') 得出的输出会变黄色,后面按照option改成了 model = net(in_nc=3, out_nc=3, nc=64, nb=23, gc=32, upscale=4, act_mode='R', upsample_mode='upconv') 得出的输出会变黑色 训练过程中的验证是能正常超分出来的

House-Leo avatar Jul 15 '20 10:07 House-Leo

model.load_state_dict(torch.load(model_path), strict=True)  # strict=False

再检查一下.

cszn avatar Jul 15 '20 11:07 cszn

@cszn 改成True后,提示以下错误 Traceback (most recent call last): File "main_test_rrdb.py", line 162, in main() File "main_test_rrdb.py", line 62, in main model.load_state_dict(torch.load(model_path), strict=True) File "/public_files/software/envs/mmsr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 847, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for RRDB: Missing key(s) in state_dict: "model.6.weight", "model.6.bias", "model.8.weight", "model.8.bias", "model.10.weight", "model.10.bias". Unexpected key(s) in state_dict: "model.5.weight", "model.5.bias", "model.7.weight", "model.7.bias".

House-Leo avatar Jul 15 '20 12:07 House-Leo

请问你是如何看直观看了loss 损失的直观感受模型的 以及可视化调参的? 难道是沿用作者大神的参数直接训练到底吗?

tongchangD avatar Oct 09 '21 03:10 tongchangD