def get_checkpoints_to_evaluate(ckpt_dir, epochs_to_eval=(), exact_ckpts=()):
  """Get file names of all checkpoints to evaluate.

  Args:
    ckpt_dir: Directory from which to load checkpoints.
    epochs_to_eval: Additional epochs to evaluate in addition to final model.
    exact_ckpts: If set, additional exact checkpoint names to evaluate.

  Returns:
    The list of checkpoints to evaluate.
  """
  # None = Current network weights (not necessarily best validation loss).
  ckpts_to_eval = [None]
  if ckpt_dir is not None:  # Evaluate saved checkpoints.
    # ckpts_to_eval = ['ckpt_100']  # Final checkpoint.
    ckpts_to_eval = ['ckpt']  # Final checkpoint.
    for epoch in epochs_to_eval:
      ckpts_to_eval.append(f'ckpt_best_of_{epoch}')
    for ckpt in exact_ckpts:
      if ckpt not in ckpts_to_eval:
        ckpts_to_eval.append(ckpt)
  return ckpts_to_eval