run_debug.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:num-seq-recognizer 作者: gmlove 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号