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()