(self, timeout=0, eval_every_steps=None)
Generator for checkpoints without evaluation results.

    Args:
      timeout: Optional timeout for waiting for new checkpoints. Set this to
        do continious evaluation.
      eval_every_steps: Only evaluate checkpoints from steps divisible by this
                         integer.

    Yields:
      Path to checkpoints that have not yet been evaluated.
Generator for checkpoints without evaluation results.
Generator for checkpoints without evaluation results .
def unevaluated_checkpoints(self, timeout=0, eval_every_steps=None):
    """Generator for checkpoints without evaluation results.

    Args:
      timeout: Optional timeout for waiting for new checkpoints. Set this to
        do continious evaluation.
      eval_every_steps: Only evaluate checkpoints from steps divisible by this
                         integer.

    Yields:
      Path to checkpoints that have not yet been evaluated.
    """
    logging.info("Looking for checkpoints in %s", self._model_dir)
    evaluated_checkpoints = self.get_checkpoints_with_results()
    last_eval = time.time()
    while True:
      unevaluated_checkpoints = []
      checkpoint_state = tf.train.get_checkpoint_state(self.model_dir)
      if checkpoint_state:
        checkpoints = set(checkpoint_state.all_model_checkpoint_paths)
        # Remove already evaluated checkpoints and sort ascending by step
        # number.
        unevaluated_checkpoints = checkpoints - evaluated_checkpoints
        step_and_ckpt = sorted(
            [(int(x.split("-")[-1]), x) for x in unevaluated_checkpoints])
        if eval_every_steps:
          step_and_ckpt = [(step, ckpt) for step, ckpt in step_and_ckpt
                           if step > 0 and step % eval_every_steps == 0]
        unevaluated_checkpoints = [ckpt for _, ckpt in step_and_ckpt]
        logging.info(
            "Found checkpoints: %s\nEvaluated checkpoints: %s\n"
            "Unevaluated checkpoints: %s", checkpoints, evaluated_checkpoints,
            unevaluated_checkpoints)
      for checkpoint_path in unevaluated_checkpoints:
        yield checkpoint_path
      if unevaluated_checkpoints:
        evaluated_checkpoints |= set(unevaluated_checkpoints)
        last_eval = time.time()
        continue
      # No new checkpoints, timeout or stop if training finished. Otherwise
      # wait 1 minute.
      if time.time() - last_eval > timeout or self.is_training_done():
        break
      time.sleep(60)
def unevaluated_checkpoints ( self , timeout = 0 , eval_every_steps = None ) : logging . info ( "Looking for checkpoints in %s" , self . _model_dir ) evaluated_checkpoints = self . get_checkpoints_with_results ( ) last_eval = time . time ( ) while True : unevaluated_checkpoints = [ ] checkpoint_state = tf . train . get_checkpoint_state ( self . model_dir ) if checkpoint_state : checkpoints = set ( checkpoint_state . all_model_checkpoint_paths ) # Remove already evaluated checkpoints and sort ascending by step # number. unevaluated_checkpoints = checkpoints - evaluated_checkpoints step_and_ckpt = sorted ( [ ( int ( x . split ( "-" ) [ - 1 ] ) , x ) for x in unevaluated_checkpoints ] ) if eval_every_steps : step_and_ckpt = [ ( step , ckpt ) for step , ckpt in step_and_ckpt if step > 0 and step % eval_every_steps == 0 ] unevaluated_checkpoints = [ ckpt for _ , ckpt in step_and_ckpt ] logging . info ( "Found checkpoints: %s\nEvaluated checkpoints: %s\n" "Unevaluated checkpoints: %s" , checkpoints , evaluated_checkpoints , unevaluated_checkpoints ) for checkpoint_path in unevaluated_checkpoints : yield checkpoint_path if unevaluated_checkpoints : evaluated_checkpoints |= set ( unevaluated_checkpoints ) last_eval = time . time ( ) continue # No new checkpoints, timeout or stop if training finished. Otherwise # wait 1 minute. if time . time ( ) - last_eval > timeout or self . is_training_done ( ) : break time . sleep ( 60 )