From 93dc01619b1612a21f063d0e56dcb25c7b596c20 Mon Sep 17 00:00:00 2001 From: Le0v1n <67271439+Le0v1n@users.noreply.github.com> Date: Sun, 29 Dec 2024 00:59:00 +0800 Subject: [PATCH] Fix Path objects lacking split method (#18427) Signed-off-by: Glenn Jocher Co-authored-by: Glenn Jocher Co-authored-by: UltralyticsAssistant --- ultralytics/cfg/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/cfg/__init__.py b/ultralytics/cfg/__init__.py index 71774cff..70ec4ef3 100644 --- a/ultralytics/cfg/__init__.py +++ b/ultralytics/cfg/__init__.py @@ -303,7 +303,7 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove if k in cfg and isinstance(cfg[k], (int, float)): cfg[k] = str(cfg[k]) if cfg.get("name") == "model": # assign model to 'name' arg - cfg["name"] = cfg.get("model", "").split(".")[0] + cfg["name"] = str(cfg.get("model", "")).split(".")[0] LOGGER.warning(f"WARNING ⚠️ 'name=model' automatically updated to 'name={cfg['name']}'.") # Type and Value checks