Catch exceptions when optional dependencies are missing (#442)
This commit is contained in:
parent
37647d835a
commit
4df4d4cc03
|
@ -3,16 +3,16 @@ from .base import LightningLoggerBase, rank_zero_only
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from .test_tube_logger import TestTubeLogger
|
from .test_tube_logger import TestTubeLogger
|
||||||
except ModuleNotFoundError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
from .mlflow_logger import MLFlowLogger
|
from .mlflow_logger import MLFlowLogger
|
||||||
except ModuleNotFoundError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
# needed to prevent ImportError and duplicated logs.
|
# needed to prevent ImportError and duplicated logs.
|
||||||
environ["COMET_DISABLE_AUTO_LOGGING"] = "1"
|
environ["COMET_DISABLE_AUTO_LOGGING"] = "1"
|
||||||
|
|
||||||
from .comet_logger import CometLogger
|
from .comet_logger import CometLogger
|
||||||
except ModuleNotFoundError:
|
except ImportError:
|
||||||
del environ["COMET_DISABLE_AUTO_LOGGING"]
|
del environ["COMET_DISABLE_AUTO_LOGGING"]
|
||||||
|
|
Loading…
Reference in New Issue