本文整理汇总了Python中graphs.get_model方法的典型用法代码示例。如果您正苦于以下问题:Python graphs.get_model方法的具体用法?Python graphs.get_model怎么用?Python graphs.get_model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graphs
的用法示例。
在下文中一共展示了graphs.get_model方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import graphs [as 别名]
# 或者: from graphs import get_model [as 别名]
def main(_):
tf.logging.set_verbosity(tf.logging.INFO)
tf.gfile.MakeDirs(FLAGS.eval_dir)
tf.logging.info('Building eval graph...')
output = graphs.get_model().eval_graph(FLAGS.eval_data)
eval_ops, moving_averaged_variables = output
saver = tf.train.Saver(moving_averaged_variables)
summary_writer = tf.summary.FileWriter(
FLAGS.eval_dir, graph=tf.get_default_graph())
while True:
run_eval(eval_ops, summary_writer, saver)
if FLAGS.run_once:
break
time.sleep(FLAGS.eval_interval_secs)
示例2: main
# 需要导入模块: import graphs [as 别名]
# 或者: from graphs import get_model [as 别名]
def main(_):
"""Trains Language Model."""
tf.logging.set_verbosity(tf.logging.INFO)
with tf.device(tf.train.replica_device_setter(FLAGS.ps_tasks)):
model = graphs.get_model()
train_op, loss, global_step = model.language_model_training()
train_utils.run_training(train_op, loss, global_step)
示例3: main
# 需要导入模块: import graphs [as 别名]
# 或者: from graphs import get_model [as 别名]
def main(_):
"""Trains LSTM classification model."""
tf.logging.set_verbosity(tf.logging.INFO)
with tf.device(tf.train.replica_device_setter(FLAGS.ps_tasks)):
model = graphs.get_model()
train_op, loss, global_step = model.classifier_training()
train_utils.run_training(
train_op,
loss,
global_step,
variables_to_restore=model.pretrained_variables,
pretrained_model_dir=FLAGS.pretrained_model_dir)