def main(unused_args):
g = tf.Graph()
with g.as_default(), tf.device('/cpu:0'):
# Build the model for evaluation.
model = create_model(FLAGS, 'eval')
model.build()
with tf.Session() as sess:
# Start the queue runners.
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(coord=coord)
# Run evaluation on the latest checkpoint.
try:
for i in range(FLAGS.total_steps):
inspect_tensors(sess)
except Exception as e: # pylint: disable=broad-except
tf.logging.error("Evaluation failed.")
coord.request_stop(e)
coord.request_stop()
coord.join(threads, stop_grace_period_secs=1)
评论列表
文章目录