解决tensorflow报错:IPython\core\interactiveshell.py:2918: UserWarning: To exit: use 'exit', 'quit'

  • 解决tensorflow报错:IPython\core\interactiveshell.py:2918: UserWarning: To exit: use ‘exit’, ‘quit’

  • 具体报错如下:

木里

  • 用 %tb追踪如下:
    木里
  • 修改代码如下:
def main(argv=None):
    # 声明处理MNIST数据集的类,这个类在初始化时会自动下载数据
    mnist=input_data.read_data_sets('./datasets/MNIST_data',one_hot=True)
    train(mnist)

# tensorflow 提供的一个主程序入口,tf.app.run会调用上面定义的main函数
if __name__=='__main__':
#    tf.app.run()
    main()
  • 即将 tf.app.run() 替换为main(),即可解决问题

猜你喜欢

转载自blog.csdn.net/mr_muli/article/details/80894341