1、TypeError: Can not convert a float32 into a Tensor or Operation.
TypeError: Can not convert a float32 into a Tensor or Operation.
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
<ipython-input-25-557426a454db> in <module>
25 sess.run(train, feed_dict={x:x_batch,y:y_batch})
26
---> 27 acc = sess.run(acc, feed_dict={x:mnist.test.images, y:mnist.test.labels})
28 print("epoch:",epoch,"acc:",acc)
run执行时报错,查阅其他博主的方法才知道是接收的参数名和run()里面的参数名一样了,更改即可
result = sess.run(acc, feed_dict={x:mnist.test.images, y:mnist.test.labels})
print("epoch:",epoch,"acc:",result)