def evaluate(estimator, eval_input_fn, checkpoint):
  """Call estimator.evaluatior with a given checkpoint."""
  try:
    tf.logging.info("***** Running evaluation *****")
    tf.logging.info("  Batch size = %d", FLAGS.eval_batch_size)
    if FLAGS.max_eval_steps:
      tf.logging.info("  eval step= %d", FLAGS.max_eval_steps)
    eval_results = estimator.evaluate(
        input_fn=eval_input_fn,
        steps=FLAGS.max_eval_steps,
        checkpoint_path=checkpoint,
        name=FLAGS.eval_filename.split(".")[0])
    tf.logging.info("Eval results: %s", eval_results)

    return eval_results["sequence_correct"]
  except tf.errors.NotFoundError:
    tf.logging.info("Checkpoint %s no longer exists, skipping.", checkpoint)
Call estimator.evaluatior with a given checkpoint.
language/xsp/training/train_model.py