From 4b9ec1b9dcdbb02c703b066c6363dcc65e113bdf Mon Sep 17 00:00:00 2001 From: Sourab Mangrulkar <13534540+pacman100@users.noreply.github.com> Date: Wed, 7 Jun 2023 22:08:04 +0530 Subject: [PATCH] fix executable batch size issue (#24067) * fix executable batch size issue * fix * undo --- src/transformers/trainer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/transformers/trainer.py b/src/transformers/trainer.py index b9203024f1b333..0468b74360ef98 100755 --- a/src/transformers/trainer.py +++ b/src/transformers/trainer.py @@ -1650,6 +1650,7 @@ def train( def _inner_training_loop( self, batch_size=None, args=None, resume_from_checkpoint=None, trial=None, ignore_keys_for_eval=None ): + self.accelerator.free_memory() self._train_batch_size = batch_size logger.debug(f"Currently training with a batch size of: {self._train_batch_size}") # Data loader and number of training steps