Add warning for task=classify with mode=track (#18621)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Ultralytics Assistant <135830346+UltralyticsAssistant@users.noreply.github.com>
This commit is contained in:
Muhammad Rizwan Munawar 2025-01-13 15:53:42 +05:00 committed by GitHub
parent 9aaf6447a2
commit 9a89186b52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -913,7 +913,12 @@ def entrypoint(debug=""):
# Task # Task
task = overrides.pop("task", None) task = overrides.pop("task", None)
if task: if task:
if task not in TASKS: if task == "classify" and mode == "track":
raise ValueError(
f"❌ Classification doesn't support 'mode=track'. Valid modes for classification are"
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}") raise ValueError(f"Invalid 'task={task}'. Valid tasks are {TASKS}.\n{CLI_HELP_MSG}")
if "model" not in overrides: if "model" not in overrides:
overrides["model"] = TASK2MODEL[task] overrides["model"] = TASK2MODEL[task]