Skip to content

Commit 653fb9e

Browse files
puhukvfdev-5
andauthored
To fix #3277 (#3280)
* To fix #3277 To fix #3277 , replace `_VALID_PARAM_AND_METRIC_NAMES ` to regular expression from `mlflow` https://github.com/mlflow/mlflow/blob/d6625d6df85b61f3661ba90efc36f94511a5c23f/mlflow/utils/validation.py#L15C1-L15C60 * autopep8 fix * Update mlflow_logger.py * Update ignite/handlers/mlflow_logger.py * Update mlflow_logger.py Remove `import re` --------- Co-authored-by: puhuk <[email protected]> Co-authored-by: vfdev <[email protected]>
1 parent e194891 commit 653fb9e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: ignite/handlers/mlflow_logger.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ def __call__(self, engine: Engine, logger: MLflowLogger, event_name: Union[str,
245245
)
246246

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

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

255255
for key in list(metrics.keys()):
256-
if not _VALID_PARAM_AND_METRIC_NAMES.match(key):
256+
if not validate_param_and_metric_name(key):
257257
warnings.warn(
258258
f"MLflowLogger output_handler encountered an invalid metric name '{key}' that "
259259
"will be ignored and not logged to MLflow"

Diff for: requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ tensorboardX
1717
visdom
1818
polyaxon
1919
wandb
20-
mlflow<2.16.0 # https://github.com/pytorch/ignite/issues/3277
20+
mlflow
2121
neptune-client>=0.16.17
2222
tensorboard
2323
torchvision

0 commit comments

Comments
 (0)