greatlog / UnpairedSR

This is an offical implementation of the CVPR2022's paper [Learning the Degradation Distribution for Blind Image Super-Resolution](https://arxiv.org/abs/2203.04962)
165 stars 12 forks source link

训练时出错,使用最新版配置文件2020Track2.yml进行训练出现错误 #18

Open LiYAnErr opened 2 years ago

LiYAnErr commented 2 years ago

(1)问题一:KeyError: 'netDeg' Traceback (most recent call last): File "train.py", line 481, in main() File "train.py", line 171, in main main_worker(0, 1, opt, args) File "train.py", line 305, in main_worker model.optimize_parameters(current_step) File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/deg_sr_model.py", line 235, in optimize_parameters loss_dict = self.optimize_trans_models(step, loss_dict) File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/deg_sr_model.py", line 149, in optimize_trans_models self.set_optimizer(names=["netDeg"], operation="zero_grad") File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/base_model.py", line 174, in set_optimizer getattr(self.optimizers[name], operation)() KeyError: 'netDeg'

(2)问题二:KeyError:'lr_adv' Traceback (most recent call last): File "train.py", line 481, in main() File "train.py", line 171, in main main_worker(0, 1, opt, args) File "train.py", line 305, in main_worker model.optimize_parameters(current_step) File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/deg_sr_model.py", line 235, in optimize_parameters loss_dict = self.optimize_trans_models(step, loss_dict) File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/deg_sr_model.py", line 164, in optimize_trans_models self.netD1, self.losses["lr_adv"], KeyError: 'lr_adv'

这两个问题都是训练时需要用到的键值在配置文件中没有。

请问作者是2020Track2.yml确有上述问题,还是我某些文件没有用到最新版呢?谢谢作者~

mrgreen3325 commented 2 years ago

(1)问题一:KeyError: 'netDeg' Traceback (most recent call last): File "train.py", line 481, in main() File "train.py", line 171, in main main_worker(0, 1, opt, args) File "train.py", line 305, in main_worker model.optimize_parameters(current_step) File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/deg_sr_model.py", line 235, in optimize_parameters loss_dict = self.optimize_trans_models(step, loss_dict) File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/deg_sr_model.py", line 149, in optimize_trans_models self.set_optimizer(names=["netDeg"], operation="zero_grad") File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/base_model.py", line 174, in set_optimizer getattr(self.optimizers[name], operation)() KeyError: 'netDeg'

(2)问题二:KeyError:'lr_adv' Traceback (most recent call last): File "train.py", line 481, in main() File "train.py", line 171, in main main_worker(0, 1, opt, args) File "train.py", line 305, in main_worker model.optimize_parameters(current_step) File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/deg_sr_model.py", line 235, in optimize_parameters loss_dict = self.optimize_trans_models(step, loss_dict) File "/6T/home/dell/LiYAnErr/UseMyDataRunBaseline/UnpairedSR-master/codes/config/PDM-SR/models/deg_sr_model.py", line 164, in optimize_trans_models self.netD1, self.losses["lr_adv"], KeyError: 'lr_adv'

这两个问题都是训练时需要用到的键值在配置文件中没有。

  • 问题一:KeyError: 'netDeg' 是在2020Track2.yml缺少优化器netDeg
  • 问题二:KeyError:'lr_adv' 是在2020Track2.yml中缺少损失函数lr_adv

请问作者是2020Track2.yml确有上述问题,还是我某些文件没有用到最新版呢?谢谢作者~

Hello, did you solve this problem? I am going to try to use the 2020Track2.yml, Is there any I need to pay attention?

LaurenceQ commented 1 year ago

您好,我遇见了同样的问题,请问您是如何解决这个问题的?