Tensorflow程序的基本框架

Tensorflow程序的基本框架

import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
def main(_):
  if not FLAGS.output_file:
    raise ValueError('You must supply the path to save to with --output_file')
  tf.logging.set_verbosity(tf.logging.INFO)
  with tf.Graph().as_default() as graph:
    if FLAGS.quantize:
      tf.contrib.quantize.create_eval_graph()

def func():
    #function content

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

猜你喜欢

转载自www.cnblogs.com/herryzz/p/10157111.html
今日推荐