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:
|
||||
from .test_tube_logger import TestTubeLogger
|
||||
except ModuleNotFoundError:
|
||||
except ImportError:
|
||||
pass
|
||||
try:
|
||||
from .mlflow_logger import MLFlowLogger
|
||||
except ModuleNotFoundError:
|
||||
except ImportError:
|
||||
pass
|
||||
try:
|
||||
# needed to prevent ImportError and duplicated logs.
|
||||
environ["COMET_DISABLE_AUTO_LOGGING"] = "1"
|
||||
|
||||
from .comet_logger import CometLogger
|
||||
except ModuleNotFoundError:
|
||||
except ImportError:
|
||||
del environ["COMET_DISABLE_AUTO_LOGGING"]
|
||||
|
|
Loading…
Reference in New Issue