Fix end2end attribute in init_criterion (#14267)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Alejandro Casanova 2024-07-09 17:46:25 +09:00 committed by GitHub
parent ec1b861392
commit c91ba7b5c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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):