当前位置: 首页>>代码示例>>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;未经允许,请勿转载。