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

To fix #3277 #3280

Merged
merged 8 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ignite/handlers/mlflow_logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""MLflow logger and its helper handlers."""

import re
vfdev-5 marked this conversation as resolved.
Show resolved Hide resolved
import warnings
from typing import Any, Callable, List, Optional, Union

Expand Down Expand Up @@ -245,15 +246,15 @@ def __call__(self, engine: Engine, logger: MLflowLogger, event_name: Union[str,
)

# Additionally recheck metric names as MLflow rejects non-valid names with MLflowException
from mlflow.utils.validation import _VALID_PARAM_AND_METRIC_NAMES
from mlflow.utils.validation import validate_param_and_metric_name

metrics = {}
for keys, value in rendered_metrics.items():
key = " ".join(keys)
metrics[key] = value

for key in list(metrics.keys()):
if not _VALID_PARAM_AND_METRIC_NAMES.match(key):
if not validate_param_and_metric_name(key):
warnings.warn(
f"MLflowLogger output_handler encountered an invalid metric name '{key}' that "
"will be ignored and not logged to MLflow"
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tensorboardX
visdom
polyaxon
wandb
mlflow<2.16.0 # https://github.com/pytorch/ignite/issues/3277
mlflow
neptune-client>=0.16.17
tensorboard
torchvision
Expand Down
Loading