diff --git a/optimum/intel/openvino/trainer.py b/optimum/intel/openvino/trainer.py index d7e1659bb5..065931c4e0 100644 --- a/optimum/intel/openvino/trainer.py +++ b/optimum/intel/openvino/trainer.py @@ -355,6 +355,9 @@ def _inner_training_loop( if model is not self.model: self.model_wrapped = model + if delay_optimizer_creation: + self.create_optimizer_and_scheduler(num_training_steps=max_steps) + # Check if saved optimizer or scheduler states exist self._load_optimizer_and_scheduler(resume_from_checkpoint)