diff --git a/ultralytics/engine/model.py b/ultralytics/engine/model.py index 43b7ccfae3..4f8209c6bc 100644 --- a/ultralytics/engine/model.py +++ b/ultralytics/engine/model.py @@ -543,9 +543,7 @@ class Model(nn.Module): prompts = args.pop("prompts", None) # for SAM-type models if not self.predictor: - self.predictor = predictor or self._smart_load("predictor")(overrides=args, _callbacks=self.callbacks) - if predictor: - self.predictor.args = get_cfg(self.predictor.args, args) + self.predictor = (predictor or self._smart_load("predictor"))(overrides=args, _callbacks=self.callbacks) self.predictor.setup_model(model=self.model, verbose=is_cli) else: # only update args if predictor is already setup self.predictor.args = get_cfg(self.predictor.args, args)