From c91ba7b5c15fe98ae4302056fbdaad40e5d32793 Mon Sep 17 00:00:00 2001 From: Alejandro Casanova <36633619+Alejandro-Casanova@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:46:25 +0900 Subject: [PATCH] Fix `end2end` attribute in `init_criterion` (#14267) Co-authored-by: UltralyticsAssistant Co-authored-by: Glenn Jocher --- ultralytics/nn/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ultralytics/nn/tasks.py b/ultralytics/nn/tasks.py index 68d4ee65..a30094c9 100644 --- a/ultralytics/nn/tasks.py +++ b/ultralytics/nn/tasks.py @@ -379,7 +379,7 @@ class DetectionModel(BaseModel): def init_criterion(self): """Initialize the loss criterion for the DetectionModel.""" - return E2EDetectLoss(self) if self.end2end else v8DetectionLoss(self) + return E2EDetectLoss(self) if getattr(self, "end2end", False) else v8DetectionLoss(self) class OBBModel(DetectionModel):