Skip to content

Commit

Permalink
update logger init (#727)
Browse files Browse the repository at this point in the history
* update logger init

* formatting
  • Loading branch information
Borda authored and williamFalcon committed Jan 23, 2020
1 parent 50881c0 commit a804755
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 7 additions & 9 deletions pytorch_lightning/logging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,41 +76,39 @@ def any_lightning_module_function_or_hook(...):
from .base import LightningLoggerBase, rank_zero_only
from .tensorboard import TensorBoardLogger

all = []
loggers = ['TensorBoardLogger']

try:
# needed to prevent ImportError and duplicated logs.
environ["COMET_DISABLE_AUTO_LOGGING"] = "1"

from .comet import CometLogger
all.append('CometLogger')
loggers.append('CometLogger')
except ImportError:
del environ["COMET_DISABLE_AUTO_LOGGING"]

try:
from .mlflow import MLFlowLogger
all.append('MLFlowLogger')
loggers.append('MLFlowLogger')
except ImportError:
pass

try:
from .neptune import NeptuneLogger
all.append('NeptuneLogger')
loggers.append('NeptuneLogger')
except ImportError:
pass

all.append('TensorBoardLogger')

try:
from .test_tube import TestTubeLogger
all.append('TestTubeLogger')
loggers.append('TestTubeLogger')
except ImportError:
pass

try:
from .wandb import WandbLogger
all.append('WandbLogger')
loggers.append('WandbLogger')
except ImportError:
pass

__all__ = all
__all__ = loggers
3 changes: 2 additions & 1 deletion pytorch_lightning/root_module/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
" and will be removed in v0.8.0", DeprecationWarning)

from pytorch_lightning.core import ( # noqa: E402
decorators, grads, hooks, root_module, memory, model_saving)
decorators, grads, hooks, root_module, memory, model_saving
)

0 comments on commit a804755

Please sign in to comment.