码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2018-06-13 11:37:34      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:run   ike   instead   custom   glob   sage   __name__   set   nts   

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

and then run your custom main function with a set of arguments.

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

标签:run   ike   instead   custom   glob   sage   __name__   set   nts   

原文地址:https://www.cnblogs.com/qingliu411/p/9175896.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!