  
  from lib.alignments import Alignments
  from lib.faces_detect import DetectedFace
  from lib.training_data import TrainingDataGenerator, stack_images
  from lib.utils import get_folder, get_image_paths
  from plugins.train._config import Config
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
  
 
</s> remove         loss = self.model.predictors[self.side].train_on_batch(*batch)
 </s> add         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 </s> remove             logger.error(str(err))
 </s> add             for line in str(err).splitlines():
                logger.error(line)
from lib.utils import FaceswapError, get_folder, get_image_paths
  
  from lib.alignments import Alignments
  from lib.faces_detect import DetectedFace
  from lib.training_data import TrainingDataGenerator, stack_images
from lib.utils import FaceswapError, get_folder, get_image_paths
  from plugins.train._config import Config
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
  
keep keep keep keep replace keep keep keep keep keep
 Useful logging message for OOM 
plugins/train/trainer/_base.py