TensorFlow 0.8でmnist_softmax.py
を実行しようとしました。 モデルテストステップの直前にy
とy_
という値を観測したいと思います。以下はテンソルでテンソルの値をプリントする方法mnist_softmax.py
コードです:
print(y) # added by me
print(y_) # added by me
# Test trained model
correct_prediction = tf.equal(tf.argmax(y, 1), tf.argmax(y_, 1))
完成したコードはGitHubで利用可能です。以下は
が出力されます。Tensor("Softmax:0", shape=(?, 10), dtype=float32)
Tensor("Placeholder_1:0", shape=(?, 10), dtype=float32)
私もsess.run(y)
、およびy.eval()
を使用しようとしましたが、私はそれしようとすると、私はこのようなエラーが出る:
tensorflow.python.framework.errors.InvalidArgumentError: You must feed a value for placeholder tensor 'Placeholder' with dtype float
[[Node: Placeholder = Placeholder[dtype=DT_FLOAT, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
Caused by op u'Placeholder', defined at: ...
次の記事をチェックしてください:http://stackoverflow.com/questions/33610685/in-tensorflow-what-is-the-difference-between-session-run-and-tensor-eval/33610914#33610914 – PseudoAj