环境: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

相关文章:

  • 2021-04-28
  • 2021-12-29
  • 2021-06-02
  • 2021-05-16
  • 2022-12-23
  • 2022-01-02
  • 2021-08-28
  • 2022-03-08
猜你喜欢
  • 2022-12-23
  • 2022-01-20
  • 2021-08-16
  • 2022-01-08
  • 2021-12-22
  • 2021-11-26
  • 2021-09-03
相关资源
相似解决方案