zudi-lin / rcan-it

Revisiting RCAN: Improved Training for Image Super-Resolution
MIT License
91 stars 16 forks source link

Fixed a bug when saving the best model #8

Closed jnpngshiii closed 2 years ago

jnpngshiii commented 2 years ago

The bug saves the latest model as the best model during training.

For example, when the code runs to line 194,

iteration 1000: PSNR: 30 best[0][idx_data, idx_scale]: 30 self.best_val_score: 0 is_best = True (30 >=0)

iteration 2000: PSNR: 29 (poor) best[0][idx_data, idx_scale]: 30 self.best_val_score: 30 is_best = True (30 >= 30. BUG appears, the code will save the model with PSNR=29 as the best model.)