I am looking at the TensorFlow \"MNIST For ML Beginners\" tutorial, and I want to print out the training loss after every training step.
My training loop currently l
Instead of just running the training_step, run also the cross_entropy node so that its value is returned to you. Remember that:
var_as_a_python_value = sess.run(tensorflow_variable)
will give you what you want, so you can do this:
[_, cross_entropy_py] = sess.run([train_step, cross_entropy],
feed_dict={x: batch_xs, y_: batch_ys})
to both run the training and pull out the value of the cross entropy as it was computed during the iteration. Note that I turned both the arguments to sess.run and the return values into a list so that both happen.