From 08e21e8b6bd618275e1dab6b862f38b39596c7de Mon Sep 17 00:00:00 2001 From: HAOCHENYE <21724054@zju.edu.cn> Date: Tue, 2 Jan 2024 11:50:01 +0800 Subject: [PATCH] Fix to dict --- mmengine/config/config.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mmengine/config/config.py b/mmengine/config/config.py index 316ac65d4d..b436d84ccf 100644 --- a/mmengine/config/config.py +++ b/mmengine/config/config.py @@ -48,7 +48,9 @@ def _lazy2string(cfg_dict, dict_type=None): if isinstance(cfg_dict, dict): dict_type = dict_type or type(cfg_dict) - return dict_type({k: _lazy2string(v) for k, v in dict.items(cfg_dict)}) + return dict_type( + {k: _lazy2string(v, dict_type) + for k, v in dict.items(cfg_dict)}) elif isinstance(cfg_dict, (tuple, list)): return type(cfg_dict)(_lazy2string(v) for v in cfg_dict) elif isinstance(cfg_dict, (LazyAttr, LazyObject)):