From 2924ebeda5bf7c6455537c2470f81e3255288ec4 Mon Sep 17 00:00:00 2001 From: Cristobal Eyzaguirre Date: Tue, 22 Oct 2019 14:06:07 -0300 Subject: [PATCH] moved COMET_DISABLE_AUTO_LOGGING out of modeule for flake8 compliance (#410) * moved COMET_DISABLE_AUTO_LOGGING out of modeule for flake8 compliance * Update __init__.py --- pytorch_lightning/logging/__init__.py | 4 ++++ pytorch_lightning/logging/comet_logger.py | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) 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):