import logging


def restore_from_checkpoint(sess, saver, checkpoint_file_path):
  """
    Restore session from checkpoint files.
    
    Args:
      sess: TensorFlow Session object.
      saver: TensorFlow Saver object.
      checkpoint_file_path: The checkpoint file path.
    
    Return:
      True if restore successfully and False if fail
    """
  if checkpoint_file_path:
    logging.info(
        "Restore session from checkpoint: {}".format(checkpoint_file_path))
    saver.restore(sess, checkpoint_file_path)
    return True
  else:
    logging.error("Checkpoint not found: {}".format(checkpoint_file_path))
    return False