Skip to content

Commit 94312a0

Browse files
committed
Suggestions
1 parent a4cb4a7 commit 94312a0

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/pytorch_lightning/CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
1111

1212
- Added an argument `include_cuda` in `pytorch_lightning.utilities.seed.isolate_rng` to disable managing `torch.cuda`'s rng ([#16423](https://github.com/Lightning-AI/lightning/pull/16423))
1313

14+
- Added support for running the `MLFlowLogger` with the `mlflow-skinny` package ([16513](https://github.com/Lightning-AI/lightning/pull/16513))
1415

1516
### Changed
1617

@@ -152,8 +153,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
152153

153154
- Fixed strict availability check for `torch_xla` requirement ([#16476](https://github.com/Lightning-AI/lightning/pull/16476))
154155

155-
- Fixed being able to use `MLFlowLogger` with the `mlflow-skinny` dependency installed ([16513](https://github.com/Lightning-AI/lightning/pull/16513))
156-
157156

158157
## [1.9.0] - 2023-01-17
159158

src/pytorch_lightning/loggers/mlflow.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737

3838
log = logging.getLogger(__name__)
3939
LOCAL_FILE_URI_PREFIX = "file:"
40-
_MLFLOW_AVAILABLE = RequirementCache("mlflow>=1.0.0") or RequirementCache("mlflow-skinny>=1.0.0")
40+
_MLFLOW_FULL_AVAILABLE = RequirementCache("mlflow>=1.0.0")
41+
_MLFLOW_SKINNY_AVAILABLE = RequirementCache("mlflow-skinny>=1.0.0")
42+
_MLFLOW_AVAILABLE = _MLFLOW_FULL_AVAILABLE or _MLFLOW_SKINNY_AVAILABLE
4143
if _MLFLOW_AVAILABLE:
4244
from mlflow.entities import Metric, Param
4345
from mlflow.tracking import context, MlflowClient
@@ -78,7 +80,7 @@ class MLFlowLogger(Logger):
7880
7981
.. code-block:: bash
8082
81-
pip install mlflow
83+
pip install mlflow # or mlflow-skinny
8284
8385
.. code-block:: python
8486
@@ -148,7 +150,9 @@ def __init__(
148150
run_id: Optional[str] = None,
149151
):
150152
if not _MLFLOW_AVAILABLE:
151-
raise ModuleNotFoundError(str(_MLFLOW_AVAILABLE))
153+
raise ModuleNotFoundError(
154+
f"{_MLFLOW_FULL_AVAILABLE!s}. You can also try {_MLFLOW_SKINNY_AVAILABLE.requirement!r}"
155+
)
152156
super().__init__()
153157
if not tracking_uri:
154158
tracking_uri = f"{LOCAL_FILE_URI_PREFIX}{save_dir}"

0 commit comments

Comments
 (0)