我試圖延長MNIST Tensorflow教程「深度學習專家」,其中我試圖打印y_conv的終值(從教程),這裏是我的代碼:MNIST tensorflow教程
with sess.as_default():
x_test=mnist.test.images[10]
x_test=np.reshape(x_test,(-1,784))
print(y_conv.eval(feed_dict={x:x_test,keep_prob:1}))
print (accuracy.eval(feed_dict={x: np.reshape(mnist.test.images[10],-1,784)
我得到一個奇怪的值y_conv:
[18.27762222 -3.28520679 2.48342848 -4.64049053 -6.00347185
-4.08683825 -1.80674195 -2.16284728 -4.48559856 1.90175676]
儘管當我在最後一行打印精度時,我得到的值爲1.0,這意味着y_conv與y的值匹配(同樣來自教程)。 關於可能出錯的任何想法..?
爲什麼你說它的奇怪? 'y_conv'似乎沒有應用'softmax'。 –