Skip to content

Commit 4420af4

Browse files
authored
Merge pull request #24 from alfredcai/alfredcai-patch-1
Update mnist_train.py
2 parents 77e5fc7 + c0a3921 commit 4420af4

File tree

1 file changed

+1
-1
lines changed
  • Deep_Learning_with_TensorFlow/1.0.0/Chapter05/5. MNIST最佳实践

1 file changed

+1
-1
lines changed

Deep_Learning_with_TensorFlow/1.0.0/Chapter05/5. MNIST最佳实践/mnist_train.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def train(mnist):
2525

2626
variable_averages = tf.train.ExponentialMovingAverage(MOVING_AVERAGE_DECAY, global_step)
2727
variables_averages_op = variable_averages.apply(tf.trainable_variables())
28-
cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(y, tf.argmax(y_, 1))
28+
cross_entropy = tf.nn.sparse_softmax_cross_entropy_with_logits(logits=y, labels=tf.argmax(y_, 1))
2929
cross_entropy_mean = tf.reduce_mean(cross_entropy)
3030
loss = cross_entropy_mean + tf.add_n(tf.get_collection('losses'))
3131
learning_rate = tf.train.exponential_decay(

0 commit comments

Comments
 (0)