if __name__ == "__main__": tf.app.run()

仰天大笑出门去,我辈岂是蓬蒿人。这篇文章主要讲述if __name__ == " __main__" : tf.app.run()相关的知识,希望能为你提供帮助。

if __name__ == "__main__": means current file is executed under a shell instead of imported as a module.

the job of  tf.app.run()  is to  first  set the global flags for later usage like

from  tensorflow.python.platform  import  flags
f = flags.FLAGS
【if __name__ == " __main__" : tf.app.run()】and then run your  custom main  function with a set of arguments.

    推荐阅读