def get_checkpoint():
  """Return checkpoint path and step, or (None, None)."""
  if FLAGS.checkpoint:
    checkpoint = os.path.join(FLAGS.model_dir, FLAGS.checkpoint)
  else:
    checkpoint = tf.train.latest_checkpoint(FLAGS.model_dir)
  # TODO(petershaw): Consider less hacky way to get current step.
  step = None
  if checkpoint is not None:
    step = int(checkpoint.split("-")[-2])
  print("Using checkpoint %s at step %s" % (checkpoint, step))
  return checkpoint, step
Return checkpoint path and step, or (None, None).
language/compgen/nqg/model/parser/inference/eval_model.py