open-mmlab / mmengine

OpenMMLab Foundational Library for Training Deep Learning Models
https://mmengine.readthedocs.io/
Apache License 2.0
1.18k stars 356 forks source link

[Bug] Fix a MLflow vis backend bug when the config key is not `str` #1579

Open zgjja opened 1 month ago

zgjja commented 1 month ago

Motivation

As title, when Config key object contains something other than str, this code would failed, a config example is in the RTMO in mmpose:

        epoch_attributes={
            280: {
                "proxy_target_cc": True,
                "overlaps_power": 1.0,
                "loss_cls.loss_weight": 2.0,
                "loss_mle.loss_weight": 5.0,
                "loss_oks.loss_weight": 10.0,
            }
        },

Modification

Fix this by converting it to str first

Use cases (Optional)

This PR only works when using MLflowVisBackend in a config file like:

vis_backends = [
    dict(type='MLflowVisBackend', save_dir='xxx', tracking_uri='http://xxx:xxx'),
    ...
]
CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.