googlecodelabs / feedback

Provide feedback to our codelabs by filing an issue here
18 stars 22 forks source link

[cloud-tensorflow-mnist]: Section 8 using tf.nn.softmax_cross_entropy_with_logits #160

Open hgarrereyn opened 7 years ago

hgarrereyn commented 7 years ago

For part 4/4 of section 8, the tutorial says to use:

cross_entropy = tf.nn.softmax_cross_entropy_with_logits(Ylogits, Y_)

However, when you use this function you must use named arguments (or it will not run):

cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits=Y, labels=Y_)

It's a technicality (and the error message you get is straightforward) but I think this might be a point of confusion for people as the line doesn't work out of the box.

hgarrereyn commented 7 years ago

Link to TensorFlow documentation: https://www.tensorflow.org/api_docs/python/tf/nn/softmax_cross_entropy_with_logits

Link to codelabs page: https://codelabs.developers.google.com/codelabs/cloud-tensorflow-mnist/#7