深入MNIST

http://wiki.jikexueyuan.com/project/tensorflow-zh/tutorials/mnist_pros.html


最后一段代码中
train_accuracy = accuracy.eval(feed_dict={x:batch[0], y_: batch[1], keep_prob: 1.0})
应改为:
train_accuracy = accuracy.eval(session=sess, feed_dict={x:batch[0], y_: batch[1], keep_prob: 1.0})


train_step.run(feed_dict={x: batch[0], y_: batch[1], keep_prob: 0.5})
应改为:
train_step.run(session=sess, feed_dict={x: batch[0], y_: batch[1], keep_prob: 0.5})

你可能感兴趣的:(深入MNIST)