Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix logged keys in mlflow logger #4412

Merged
merged 9 commits into from
Nov 10, 2020
4 changes: 4 additions & 0 deletions pytorch_lightning/loggers/mlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
MLflow
------
"""
import re
from argparse import Namespace
from time import time
from typing import Any, Dict, Optional, Union
Expand Down Expand Up @@ -151,6 +152,9 @@ def log_metrics(self, metrics: Dict[str, float], step: Optional[int] = None) ->
if isinstance(v, str):
log.warning(f'Discarding metric with string value {k}={v}.')
continue
# MLFlow does not support some special characters in metric name.
k = re.sub("[^a-zA-Z0-9_/. -]+", "", k)
Borda marked this conversation as resolved.
Show resolved Hide resolved

self.experiment.log_metric(self.run_id, k, v, timestamp_ms, step)

@rank_zero_only
Expand Down