Fix validation callbacks not triggered during OBB model training (#18175)

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
dagokl 2024-12-11 21:05:27 +01:00 committed by GitHub
parent 7f37790134
commit 4cef9d047e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -39,4 +39,6 @@ class OBBTrainer(yolo.detect.DetectionTrainer):
def get_validator(self):
"""Return an instance of OBBValidator for validation of YOLO model."""
self.loss_names = "box_loss", "cls_loss", "dfl_loss"
return yolo.obb.OBBValidator(self.test_loader, save_dir=self.save_dir, args=copy(self.args))
return yolo.obb.OBBValidator(
self.test_loader, save_dir=self.save_dir, args=copy(self.args), _callbacks=self.callbacks
)