我正在将功能性python代码导入Jupyter NB,并且tf.app.run()方法遇到问题。下面是运行tf.app.run()时收到的错误消息:
An exception has occurred, use %tb to see the full traceback.
SystemExit
/opt/conda/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2971: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)
完整的追溯可以在这里找到:
SystemExit Traceback (most recent call last)
<ipython-input-2-e221ce66f998> in <module>()
125
126 # if __name__ == "__main__":
--> 127 tf.app.run()
/opt/conda/lib/python3.6/site-packages/tensorflow/python/platform/app.py in run(main, argv)
124 # Call the main function, passing through any arguments
125 # to the final program.
--> 126 _sys.exit(main(argv))
127
128
SystemExit:
如上所述,该错误来自tensorflow的app.py文件(下面的链接)。但是,我很困惑为什么该错误没有出现在CMI中时为什么会出现在IPython中。 https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/platform/app.py
任何建议都值得赞赏!