對於
sess = tf.InteractiveSession()
train_step.run(feed_dict = {x: batch[0], y_: batch[1], keep_prob: 0.5})
print(y_conv.eval(feed_dict = {x: mnist.test.images[0:1],
y_: mnist.test.labels[0:1], keep_prob: 1.0}))
想要輸出某一個輸入的運算結果,需要feed給該tensor一個輸入,格式和自己定義的placeholder一樣。詳見:鏈接
否則如果直接輸出的話只輸出tensor的格式:Tensor("Softmax:0", shape=(?, 10), dtype=float32)