leeyoshinari / YOLO_v2

The implementation of YOLO v2 with TensorFlow
GNU General Public License v3.0
80 stars 38 forks source link

NAN for loss Calculation #39

Open Ajaz-Ahmad opened 5 years ago

Ajaz-Ahmad commented 5 years ago

Hi,

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

chentingkai commented 4 years ago

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

Ajaz-Ahmad commented 4 years ago

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.

jks88990041 commented 2 years ago

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 commented 2 years ago

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?