diff --git a/pytorch_lightning/logging/__init__.py b/pytorch_lightning/logging/__init__.py index 01f0a27677..7a265b4c84 100644 --- a/pytorch_lightning/logging/__init__.py +++ b/pytorch_lightning/logging/__init__.py @@ -1,3 +1,4 @@ +from os import environ from .base import LightningLoggerBase, rank_zero_only try: @@ -10,5 +11,8 @@ except ModuleNotFoundError: pass try: from .comet_logger import CometLogger + + # needed to prevent ImportError and duplicated logs. + environ["COMET_DISABLE_AUTO_LOGGING"] = "1" except ModuleNotFoundError: pass diff --git a/pytorch_lightning/logging/comet_logger.py b/pytorch_lightning/logging/comet_logger.py index e2ac0c2401..dc05a9a91c 100644 --- a/pytorch_lightning/logging/comet_logger.py +++ b/pytorch_lightning/logging/comet_logger.py @@ -4,9 +4,6 @@ from comet_ml import Experiment as CometExperiment from .base import LightningLoggerBase, rank_zero_only -# needed to prevent ImportError and duplicated logs. -environ["COMET_DISABLE_AUTO_LOGGING"] = "1" - class CometLogger(LightningLoggerBase): def __init__(self, *args, **kwargs):