hwalsuklee / tensorflow-mnist-VAE

Tensorflow implementation of variational auto-encoder for MNIST
492 stars 182 forks source link

Nan Loss #4

Open shidilrzf opened 6 years ago

shidilrzf commented 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?

jaekyeom commented 5 years ago

That's probably because tf.log got 0 as input. Try using tf.nn.sigmoid_cross_entropy_with_logits.