【发布时间】:2016-12-21 06:56:27
【问题描述】:
在tensorflow的MNIST教程中,最后一步是使用如下代码输出模型的测试准确率:
# Test trained model
correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(y_, 1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
print(sess.run(accuracy, feed_dict={x: mnist.test.images,
y_: mnist.test.labels}))
但是,我想知道如何修改此代码以输出测试集的预测值(标签),而不仅仅是打印出准确性?
这是教程的链接:https://www.tensorflow.org/tutorials/mnist/beginners/
【问题讨论】:
标签: graph machine-learning computer-vision tensorflow deep-learning