環境:Python3.6.6 + tensorflow-gpu
源碼如下:
import tensorflow as tf def main(): print("hello tf.app.run") if __name__ == '__main__': tf.app.run()
運行完后,提示
Exception has occurred: SystemExit exception: no description File "/home/work/Downloads/SSD-Tensorflow/test.py", line 10, in <module> tf.app.run()
改為直接調用main()函數,就好了。
import tensorflow as tf def main(): print("hello tf.app.run") if __name__ == '__main__': main()
即便不改,程序結果也是正確的。
參考了:https://blog.csdn.net/forestlinzi0059/article/details/79016700