LeiaLi / SRDiff

171 stars 19 forks source link

About optimizer.zero_grad in tasks/trainer.py #15

Open stayhungry1 opened 1 year ago

stayhungry1 commented 1 year ago

Hello @LeiaLi ! I'm impressed by your nice work and have tried the code. I have a small problem for Lines 76 and 77 in tasks/trainer.py, where 'Optimizer.zero_grad' is used after 'loss=model.forward()'. I wonder if 'optimizer.zero_grad' should be placed before 'model forward'.

Thank you very much! Looking forward to your reply.