From 7bd3b2ce1932fe96d7a48cd8035ec7aff99bd55d Mon Sep 17 00:00:00 2001 From: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> Date: Thu, 5 Mar 2026 21:26:28 +0600 Subject: [PATCH] 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 --- ultralytics/utils/tuner.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ultralytics/utils/tuner.py b/ultralytics/utils/tuner.py index 694a4e00..9f290964 100644 --- a/ultralytics/utils/tuner.py +++ b/ultralytics/utils/tuner.py @@ -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)