          amd_ver = 2.2
          min_ver = 2.7
          max_ver = 2.9
          try:
              # Ensure tensorflow doesn't pin all threads to one core when using Math Kernel Library
              os.environ["TF_MIN_GPU_MULTIPROCESSOR_COUNT"] = "4"
              os.environ["KMP_AFFINITY"] = "disabled"
              import tensorflow as tf  # noqa pylint:disable=import-outside-toplevel,unused-import
          except ImportError as err:
              if "DLL load failed while importing" in str(err):
                  msg = (
                      f"A DLL library file failed to load. Make sure that you have Microsoft Visual "
 
</s> remove             loss = self._model.model.train_on_batch(model_inputs, y=model_targets)
 </s> add             loss: List[float] = self._model.model.train_on_batch(model_inputs, y=model_targets) </s> remove from lib.training import TrainingDataGenerator
 </s> add from lib.training import PreviewDataGenerator, TrainingDataGenerator
from lib.training.generator import BatchType, ConfigType, DataGenerator </s> remove         Returns
        -------
        bool
            ``True`` if the cache has been reset because of a face centering change due to
            legacy alignments, otherwise ``False``. """
        retval = self._has_reset
        if retval:
            logger.debug("Resetting 'has_reset' flag")
            self._has_reset = False
        return retval
 </s> add         Raises
        ------
        :class:`FaceswapError`
            If the number of images loaded is smaller than the selected batch size
        """
        length = len(self._images)
        msg = ("Number of images is lower than batch-size (Note that too few images may lead to "
               f"bad training). # images: {length}, batch-size: {self._batch_size}")
        try:
            assert length >= self._batch_size, msg
        except AssertionError as err:
            msg += ("\nYou should increase the number of images in your training set or lower "
                    "your batch-size.")
            raise FaceswapError(msg) from err
          amd_ver = 2.2
          min_ver = 2.7
          max_ver = 2.9
          try:



              import tensorflow as tf  # noqa pylint:disable=import-outside-toplevel,unused-import
          except ImportError as err:
              if "DLL load failed while importing" in str(err):
                  msg = (
                      f"A DLL library file failed to load. Make sure that you have Microsoft Visual "
keep keep keep keep replace replace replace keep keep keep keep keep
 Data Augmentation update (#1263)

- lib.detected_face
    - Subclass Masks for Landmark based masks
    - Add training mask propery + methods to DetectedFace
  - lib.training_training
    - subclass TrainingDataGenerator for training and preview data
    - Split cache into own module
    - Reduce thread count to 1 to prevent image corruption + data re-use
    - Process on largest model input/output size rather than stored image size
    - Size and crop masks during caching stage
    - Implement ring buffer for data flow
    - Fix preview reload bug
  - augmentation
    - typing
    - switch color aug order
    - better initialization
    - Fix warp + landmark warp to correctly apply at different image scales
    - Slightly improved warp caching
    - Don't store whether image is_preview. Handle all data as training images implicitly
  - plugins.trainer: Typing and fixes to work with trainingdata refactor 
lib/cli/launcher.py