Open shidilrzf opened 6 years ago
Sometimes when I try this code, I get a Nan loss. For example the loss for epoch "i" is 100 and the loss for epoch "i+1" is Nan... Do you have any idea why this happens?
That's probably because tf.log got 0 as input. Try using tf.nn.sigmoid_cross_entropy_with_logits.
tf.log
0
tf.nn.sigmoid_cross_entropy_with_logits
Sometimes when I try this code, I get a Nan loss. For example the loss for epoch "i" is 100 and the loss for epoch "i+1" is Nan... Do you have any idea why this happens?