diff --git a/ultralytics/cfg/__init__.py b/ultralytics/cfg/__init__.py index bd06af1d..8cb29bc2 100644 --- a/ultralytics/cfg/__init__.py +++ b/ultralytics/cfg/__init__.py @@ -280,7 +280,7 @@ def get_cfg(cfg: Union[str, Path, Dict, SimpleNamespace] = DEFAULT_CFG_DICT, ove Examples: >>> from ultralytics.cfg import get_cfg >>> config = get_cfg() # Load default configuration - >>> config = get_cfg("path/to/config.yaml", overrides={"epochs": 50, "batch_size": 16}) + >>> config_with_overrides = get_cfg("path/to/config.yaml", overrides={"epochs": 50, "batch_size": 16}) Notes: - If both `cfg` and `overrides` are provided, the values in `overrides` will take precedence. @@ -919,7 +919,13 @@ def entrypoint(debug=""): f" {MODES - {'track'}}.\n{CLI_HELP_MSG}" ) elif task not in TASKS: - raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}") + if task == "track": + LOGGER.warning( + "WARNING ⚠️ invalid 'task=track', setting 'task=detect' and 'mode=track'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}." + ) + task, mode = "detect", "track" + else: + raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}") if "model" not in overrides: overrides["model"] = TASK2MODEL[task]