MLFlow now uses env variable as default tracking uri (#7457)

* Clarify logger flag

Clarify behavior of boolean values on the logger flag for Trainer.

* Update docs/source/common/trainer.rst

* doc

* MLFlow now uses env variable as default tracking uri

Solves https://github.com/PyTorchLightning/pytorch-lightning/issues/6894

* Update pytorch_lightning/loggers/mlflow.py

Co-authored-by: thomas chaton <thomas@grid.ai>

* changelog

Co-authored-by: SpontaneousDuck <kennywitham4@gmail.com>
Co-authored-by: Ethan Harris <ewah1g13@soton.ac.uk>
Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: thomas chaton <thomas@grid.ai>
Co-authored-by: jirka <jirka.borovec@seznam.cz>
This commit is contained in:
Federico Simonetta 2021-05-12 11:26:57 +02:00 committed by GitHub
parent b9a52fa2ef
commit 8cdbd03d02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -41,6 +41,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Changed `model.state_dict()` in `CheckpointConnector` to allow `training_type_plugin` to customize the model's `state_dict()` ([7474](https://github.com/PyTorchLightning/pytorch-lightning/pull/7474))
- MLflowLogger now uses the env variable `MLFLOW_TRACKING_URI` as default tracking uri ([7457](https://github.com/PyTorchLightning/pytorch-lightning/pull/7457))
### Deprecated

View File

@ -16,6 +16,7 @@ MLflow Logger
-------------
"""
import logging
import os
import re
from argparse import Namespace
from time import time
@ -85,7 +86,8 @@ class MLFlowLogger(LightningLoggerBase):
Args:
experiment_name: The name of the experiment
tracking_uri: Address of local or remote tracking server.
If not provided, defaults to `file:<save_dir>`.
If not provided, defaults to `MLFLOW_TRACKING_URI` environment variable if set, otherwise it falls
back to `file:<save_dir>`.
tags: A dictionary tags for the experiment.
save_dir: A path to a local directory where the MLflow runs get saved.
Defaults to `./mlflow` if `tracking_uri` is not provided.
@ -104,7 +106,7 @@ class MLFlowLogger(LightningLoggerBase):
def __init__(
self,
experiment_name: str = 'default',
tracking_uri: Optional[str] = None,
tracking_uri: Optional[str] = os.getenv('MLFLOW_TRACKING_URI'),
tags: Optional[Dict[str, Any]] = None,
save_dir: Optional[str] = './mlruns',
prefix: str = '',