YOLO_v2 icon indicating copy to clipboard operation
YOLO_v2 copied to clipboard

NAN for loss Calculation

Open Ajaz-Ahmad opened this issue 5 years ago • 4 comments

Hi,

When training the network it often says NAN for loss calculation. Can you tell the issue? thnks

Ajaz-Ahmad avatar Aug 02 '19 23:08 Ajaz-Ahmad

hello, When i train your model on VOC2007, the loss is NAN frequently, can you tell me how to solve it ? thank you very much

chentingkai avatar Oct 14 '19 11:10 chentingkai

Hello Chentingkai,

I too faced the same problem. But, then I wrote my own code. This happens because the loss function calculation goes out of range. Try initializing weights using https://www.tensorflow.org/api_docs/python/tf/initializers/he_normal. Hope this will solve your problem or its better to write your own loss function.

Ajaz-Ahmad avatar Oct 14 '19 22:10 Ajaz-Ahmad

hello, When i train your model on VOC2007, the loss is NAN frequently, can you tell me how to solve it ? thank you very much

大连的兄弟。你解决这个NAN的问题了么,求赐教。

jks88990041 avatar Oct 16 '21 14:10 jks88990041

Hello Chentingkai,

I too faced the same problem. But, then I wrote my own code. This happens because the loss function calculation goes out of range. Try initializing weights using https://www.tensorflow.org/api_docs/python/tf/initializers/he_normal. Hope this will solve your problem or its better to write your own loss function.

Hello I don't really understand what you suggest. I am a truly freshman. Can you give me an example ? How to solve the problem about NAN?

jks88990041 avatar Oct 16 '21 14:10 jks88990041