Reset trainer before each trial with Ray Tune (#23793)

Signed-off-by: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Mohammed Yasin 2026-03-05 21:26:28 +06:00 committed by GitHub
parent d0f665ff0e
commit 7bd3b2ce19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,6 +88,7 @@ def run_ray_tune(
def _tune(config):
"""Train the YOLO model with the specified hyperparameters and return results."""
model_to_train = ray.get(model_in_store) # get the model from ray store for tuning
model_to_train.trainer = None
model_to_train.reset_callbacks()
config.update(train_args)