parameters: (self)
return_statement: return chkpt
docstring: Copy over the latest checkpoints to the target directory.
docstring_summary: Copy over the latest checkpoints to the target directory.
docstring_tokens: Copy over the latest checkpoints to the target directory .
function: def copy_latest_checkpoint(self):
      """Copy over the latest checkpoints to the target directory."""
      chkpt = get_latest_checkpoint(self.model_directory)
      logging.info('Got latest checkpoint: %s', chkpt)
      if chkpt is None:
        return None
      # Check if the evaluation meta graph has been copied.
      if self.has_checkpoint() is None:
        # Don't copy temp export folders, e.g. 'temp-01234567/saved_model.pb'
        export_file = gfile.Glob(
            os.path.join(self.model_directory,
                         'export/best_exporter/[0-9]*/saved_model.pb'))[0]
        logging.info('Copying eval export file: %s', ', '.join(export_file))
        target_export_dir = os.path.join(
            self.target_directory, 'export/best_exporter',
            os.path.basename(os.path.dirname(export_file)))
        gfile.MakeDirs(target_export_dir)
        verbose_copy(
            export_file,
            os.path.join(target_export_dir, os.path.basename(export_file)))
      files = gfile.Glob(os.path.join(self.model_directory, chkpt) + b'.*')
      logging.info('Copying files: %s', ', '.join(files))
      for fname in files:
        verbose_copy(fname,
                     os.path.join(self.target_directory, os.path.basename(fname)))
      return chkpt
function_tokens: def copy_latest_checkpoint ( self ) : chkpt = get_latest_checkpoint ( self . model_directory ) logging . info ( 'Got latest checkpoint: %s' , chkpt ) if chkpt is None : return None # Check if the evaluation meta graph has been copied. if self . has_checkpoint ( ) is None : # Don't copy temp export folders, e.g. 'temp-01234567/saved_model.pb' export_file = gfile . Glob ( os . path . join ( self . model_directory , 'export/best_exporter/[0-9]*/saved_model.pb' ) ) [ 0 ] logging . info ( 'Copying eval export file: %s' , ', ' . join ( export_file ) ) target_export_dir = os . path . join ( self . target_directory , 'export/best_exporter' , os . path . basename ( os . path . dirname ( export_file ) ) ) gfile . MakeDirs ( target_export_dir ) verbose_copy ( export_file , os . path . join ( target_export_dir , os . path . basename ( export_file ) ) ) files = gfile . Glob ( os . path . join ( self . model_directory , chkpt ) + b'.*' ) logging . info ( 'Copying files: %s' , ', ' . join ( files ) ) for fname in files : verbose_copy ( fname , os . path . join ( self . target_directory , os . path . basename ( fname ) ) ) return chkpt