Shortcuts

mmcv.runner.hooks.logger.segmind 源代码

# Copyright (c) OpenMMLab. All rights reserved.
from ...dist_utils import master_only
from ..hook import HOOKS
from .base import LoggerHook


[文档]@HOOKS.register_module() class SegmindLoggerHook(LoggerHook): """Class to log metrics to Segmind. It requires `Segmind`_ to be installed. Args: interval (int): Logging interval (every k iterations). Default: 10. ignore_last (bool): Ignore the log of last iterations in each epoch if less than `interval`. Default True. reset_flag (bool): Whether to clear the output buffer after logging. Default False. by_epoch (bool): Whether EpochBasedRunner is used. Default True. .. _Segmind: https://docs.segmind.com/python-library """ def __init__(self, interval: int = 10, ignore_last: bool = True, reset_flag: bool = False, by_epoch=True): super().__init__(interval, ignore_last, reset_flag, by_epoch) self.import_segmind() def import_segmind(self) -> None: try: import segmind except ImportError: raise ImportError( "Please run 'pip install segmind' to install segmind") self.log_metrics = segmind.tracking.fluent.log_metrics self.mlflow_log = segmind.utils.logging_utils.try_mlflow_log @master_only def log(self, runner) -> None: tags = self.get_loggable_tags(runner) if tags: # logging metrics to segmind self.mlflow_log( self.log_metrics, tags, step=runner.epoch, epoch=runner.epoch)
Read the Docs v: v1.6.2
Versions
latest
stable
2.x
v1.6.2
v1.6.1
v1.6.0
v1.5.3
v1.5.2_a
v1.5.1
v1.5.0
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.18
v1.3.17
v1.3.16
v1.3.15
v1.3.14
v1.3.13
dev-2.x
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.