Zero-DCE_extension icon indicating copy to clipboard operation
Zero-DCE_extension copied to clipboard

[nan loss occur]

Open CaptainEven opened this issue 3 years ago • 5 comments

Hi, nan loss occured when training on some images. How to solve this?

CaptainEven avatar Jul 20 '21 02:07 CaptainEven

try to decrease your learning rate. Or please check the training data.

Even @.***> 于2021年7月20日周二 上午10:31写道:

Hi, nan loss occured when training on some images. How to solve this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Li-Chongyi/Zero-DCE_extension/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIEVQEJD7P5VMBGJFPRJ2Z3TYTNY5ANCNFSM5AU3IWVA .

Li-Chongyi avatar Jul 20 '21 15:07 Li-Chongyi

Hi, nan loss occured when training on some images. How to solve this?

hi i have the same question and have you solved it

senlin-ali avatar Nov 18 '21 09:11 senlin-ali

Hi, the same question, has anyone solved it?

Wuwang365 avatar Nov 25 '21 11:11 Wuwang365

same question

Zruto avatar Jan 09 '22 07:01 Zruto

This may be caused by the color loss defined in L_color class (line 9 in Myloss.py), where torch.pow(xx+xx+xx, 0.5) is used. Note that the gradient of sqrt(x) is 1/2*sqrt(x), which is not derivable when x=0. Therefore by changing torch.pow(xx+xx+xx, 0.5) to torch.pow(xx+xx+xx+1e-5, 0.5), this problem is solved in my case. However, the color loss can be modified as is written in the paper. For example, k= (mr-mb)**2+(mr-mg)**2+(mb-mg)**2 .

Schizophreni avatar Jan 10 '22 14:01 Schizophreni