运行tensorflow的例子,出现Process finished with exit code 3问题

来源:互联网 发布:seo技术培训 陕西 编辑:程序博客网 时间:2024/06/07 07:06
最近学习tensorflow。按照手册学习到Deep MNIST for Experts时,出现

test_accuracy = accuracy.eval(feed_dict={x: mnist.test.images, y_: mnist.test.labels, keep_prob:1.0})这条语句不执行,后面的代码也没执行。但是没报错,显示Process finished with exit code 3。

  没搜到exit code 3是什么原因导致的,一般程序正常运行显示的是Precess finished with exit code 0.

  调试状态下,执行到上面那条语句时,程序也是不执行了,一个变量的值都不显示。

  调用资源管理器,看到代码运行时,cpu 使用率接近100%,内存使用2G左右。后来猜想可能mnist.test.images太大了,运行不了,mnist.test.images有10000张。将代码改为

test_accuracy = accuracy.eval(feed_dict={x: mnist.test.images[0:2000], y_: mnist.test.labels[0:2000], keep_prob: 1.0}),只用到test数据
集的一部分。代码就可以运行了。附张运行的结果图。手册上的代码是训练20000次,准确率能达到99.2%。我只训练了5000次,准确率为98.65%。

0 0
原创粉丝点击