当前位置: 首页>>代码示例>>Python>>正文


Python tf_logging.ERROR属性代码示例

本文整理汇总了Python中tensorflow.python.platform.tf_logging.ERROR属性的典型用法代码示例。如果您正苦于以下问题:Python tf_logging.ERROR属性的具体用法?Python tf_logging.ERROR怎么用?Python tf_logging.ERROR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在tensorflow.python.platform.tf_logging的用法示例。


在下文中一共展示了tf_logging.ERROR属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: log

# 需要导入模块: from tensorflow.python.platform import tf_logging [as 别名]
# 或者: from tensorflow.python.platform.tf_logging import ERROR [as 别名]
def log(level, message, *args):
  """Conditionally logs `message % args` at the level `level`.

  Note that tensorboard_logging verbosity and logging verbosity are separate;
  the message will always be passed through to the logging module regardless of
  whether it passes the tensorboard_logging verbosity check.

  Args:
    level: The verbosity level to use. Must be one of
      tensorboard_logging.{DEBUG, INFO, WARN, ERROR, FATAL}.
    message: The message template to use.
    *args: Arguments to interpolate to the message template, if any.

  Raises:
    ValueError: If `level` is not a valid logging level.
    RuntimeError: If the `SummaryWriter` to use has not been set.
  """
  if _summary_writer is _sentinel_summary_writer:
    raise RuntimeError('Must call set_summary_writer before doing any '
                       'logging from tensorboard_logging')
  _check_verbosity(level)
  proto_level = _LEVEL_PROTO_MAP[level]
  if proto_level >= _LEVEL_PROTO_MAP[_verbosity]:
    log_message = event_pb2.LogMessage(level=proto_level,
                                       message=message % args)
    event = event_pb2.Event(wall_time=time.time(), log_message=log_message)

    if _summary_writer:
      _summary_writer.add_event(event)

  logging.log(_PLATFORM_LOGGING_LEVEL_MAP[level], message, *args) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:33,代码来源:tensorboard_logging.py

示例2: error

# 需要导入模块: from tensorflow.python.platform import tf_logging [as 别名]
# 或者: from tensorflow.python.platform.tf_logging import ERROR [as 别名]
def error(message, *args):
  log(ERROR, message, *args) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:4,代码来源:tensorboard_logging.py

示例3: _ProcessHealthPillSummary

# 需要导入模块: from tensorflow.python.platform import tf_logging [as 别名]
# 或者: from tensorflow.python.platform.tf_logging import ERROR [as 别名]
def _ProcessHealthPillSummary(self, value, event):
    """Process summaries containing health pills.

    These summaries are distinguished by the fact that they have a Tensor field
    and have a special tag value.

    This method emits ERROR-level messages to the logs if it encounters Tensor
    summaries that it cannot process.

    Args:
      value: A summary_pb2.Summary.Value with a Tensor field.
      event: The event_pb2.Event containing that value.
    """
    elements = tensor_util.MakeNdarray(value.tensor)

    # The node_name property of the value object is actually a watch key: a
    # combination of node name, output slot, and a suffix. We capture the
    # actual node name and the output slot with a regular expression.
    match = re.match(r'^(.*):(\d+):DebugNumericSummary$', value.node_name)
    if not match:
      logging.log_first_n(
          logging.ERROR,
          'Unsupported watch key %s for health pills; skipping this sequence.',
          1,
          value.node_name)
      return

    node_name = match.group(1)
    output_slot = int(match.group(2))
    self._ProcessHealthPill(
        event.wall_time, event.step, node_name, output_slot, elements) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:33,代码来源:event_accumulator.py


注:本文中的tensorflow.python.platform.tf_logging.ERROR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。