當前位置: 首頁>>代碼示例>>Python>>正文


Python training.NewCheckpointReader方法代碼示例

本文整理匯總了Python中tensorflow.python.training.training.NewCheckpointReader方法的典型用法代碼示例。如果您正苦於以下問題:Python training.NewCheckpointReader方法的具體用法?Python training.NewCheckpointReader怎麽用?Python training.NewCheckpointReader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tensorflow.python.training.training的用法示例。


在下文中一共展示了training.NewCheckpointReader方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load_checkpoint

# 需要導入模塊: from tensorflow.python.training import training [as 別名]
# 或者: from tensorflow.python.training.training import NewCheckpointReader [as 別名]
def load_checkpoint(ckpt_dir_or_file):
  """Returns `CheckpointReader` for checkpoint found in `ckpt_dir_or_file`.

  If `ckpt_dir_or_file` resolves to a directory with multiple checkpoints,
  reader for the latest checkpoint is returned.

  Args:
    ckpt_dir_or_file: Directory with checkpoints file or path to checkpoint
      file.

  Returns:
    `CheckpointReader` object.

  Raises:
    ValueError: If `ckpt_dir_or_file` resolves to a directory with no
      checkpoints.
  """
  filename = _get_checkpoint_filename(ckpt_dir_or_file)
  if filename is None:
    raise ValueError("Couldn't find 'checkpoint' file or checkpoints in "
                     "given directory %s" % ckpt_dir_or_file)
  return train.NewCheckpointReader(filename) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:24,代碼來源:checkpoint_utils.py

示例2: load_checkpoint

# 需要導入模塊: from tensorflow.python.training import training [as 別名]
# 或者: from tensorflow.python.training.training import NewCheckpointReader [as 別名]
def load_checkpoint(filepattern):
  """Returns CheckpointReader for latest checkpoint.

  Args:
    filepattern: Directory with checkpoints file or path to checkpoint.

  Returns:
    `CheckpointReader` object.

  Raises:
    ValueError: if checkpoint_dir doesn't have 'checkpoint' file or checkpoints.
  """
  filename = _get_checkpoint_filename(filepattern)
  if filename is None:
    raise ValueError("Couldn't find 'checkpoint' file or checkpoints in "
                     "given directory %s" % filepattern)
  return train.NewCheckpointReader(filename) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:19,代碼來源:checkpoint_utils.py

示例3: list_variables

# 需要導入模塊: from tensorflow.python.training import training [as 別名]
# 或者: from tensorflow.python.training.training import NewCheckpointReader [as 別名]
def list_variables(filename):
    reader = training.NewCheckpointReader(filename)
    variable_map = reader.get_variable_to_shape_map()
    names = sorted(variable_map.keys())
    return names 
開發者ID:GaoangW,項目名稱:TNT,代碼行數:7,代碼來源:facenet.py

示例4: _load_global_step_from_checkpoint_dir

# 需要導入模塊: from tensorflow.python.training import training [as 別名]
# 或者: from tensorflow.python.training.training import NewCheckpointReader [as 別名]
def _load_global_step_from_checkpoint_dir(checkpoint_dir):
  try:
    checkpoint_reader = training.NewCheckpointReader(
        training.latest_checkpoint(checkpoint_dir))
    return checkpoint_reader.get_tensor(ops.GraphKeys.GLOBAL_STEP)
  except:  # pylint: disable=bare-except
    return 0 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:9,代碼來源:estimator.py

示例5: list_variables

# 需要導入模塊: from tensorflow.python.training import training [as 別名]
# 或者: from tensorflow.python.training.training import NewCheckpointReader [as 別名]
def list_variables(filename):

    logger.info(msg="list_variables called")
    reader = training.NewCheckpointReader(filename)
    variable_map = reader.get_variable_to_shape_map()
    names = sorted(variable_map.keys())
    return names 
開發者ID:pymit,項目名稱:Rekognition,代碼行數:9,代碼來源:facenet.py


注:本文中的tensorflow.python.training.training.NewCheckpointReader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。