      def train_one_batch(self, do_preview):
          """ Train a batch """
          logger.trace("Training one step: (side: %s)", self.side)
          batch = self.get_next(do_preview)
          loss = self.model.predictors[self.side].train_on_batch(*batch)
          loss = loss if isinstance(loss, list) else [loss]
          return loss
  
      def get_next(self, do_preview):
          """ Return the next batch from the generator
 
</s> remove from lib.utils import get_folder, get_image_paths
 </s> add from lib.utils import FaceswapError, get_folder, get_image_paths </s> remove             logger.error(str(err))
 </s> add             for line in str(err).splitlines():
                logger.error(line)
        try:
            loss = self.model.predictors[self.side].train_on_batch(*batch)
        except tf_errors.ResourceExhaustedError as err:
            msg = ("You do not have enough GPU memory available to train the selected model at "
                   "the selected settings. You can try a number of things:"
                   "\n1) Close any other application that is using your GPU (web browsers are "
                   "particularly bad for this)."
                   "\n2) Lower the batchsize (the amount of images fed into the model each "
                   "iteration)."
                   "\n3) Try Memory Saving Gradients and/or Ping Pong Training."
                   "\n4) Use a more lightweight model, or select the model's 'LowMem' option "
                   "(in config) if it has one.")
            raise FaceswapError(msg) from err
      def train_one_batch(self, do_preview):
          """ Train a batch """
          logger.trace("Training one step: (side: %s)", self.side)
          batch = self.get_next(do_preview)
        try:
            loss = self.model.predictors[self.side].train_on_batch(*batch)
        except tf_errors.ResourceExhaustedError as err:
            msg = ("You do not have enough GPU memory available to train the selected model at "
                   "the selected settings. You can try a number of things:"
                   "\n1) Close any other application that is using your GPU (web browsers are "
                   "particularly bad for this)."
                   "\n2) Lower the batchsize (the amount of images fed into the model each "
                   "iteration)."
                   "\n3) Try Memory Saving Gradients and/or Ping Pong Training."
                   "\n4) Use a more lightweight model, or select the model's 'LowMem' option "
                   "(in config) if it has one.")
            raise FaceswapError(msg) from err
          loss = loss if isinstance(loss, list) else [loss]
          return loss
  
      def get_next(self, do_preview):
          """ Return the next batch from the generator
keep keep keep keep replace keep keep keep keep keep
 Useful logging message for OOM 
plugins/train/trainer/_base.py