          if self.config["learn_mask"] and self.config["mask_type"] is None:
              raise FaceswapError("'Learn Mask' has been selected but you have not chosen a Mask to "
                                  "use. Please select a mask or disable 'Learn Mask'.")
  
          self._mixed_precision = self.config["mixed_precision"] and get_backend() != "amd"
          # self._io = IO(self, model_dir, self._is_predict, self.config["save_optimizer"])
          # TODO - Re-enable saving of optimizer once this bug is fixed:
          # File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
          # File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
          # File "h5py/h5d.pyx", line 87, in h5py.h5d.create
 
</s> remove         if get_backend() == "amd" and model.no_amd:
            valid = [k for k, v in _MODEL_MAPPING.items() if not v.no_amd]
            raise FaceswapError(f"'{arch}' is not compatible with the AMD backend. Choose one of "
                                f"{valid}.")

 </s> add  </s> remove         if backend != "amd" and tf_ver < min_ver:
 </s> add         if tf_ver < min_ver: </s> remove         except Exception as err:
            if get_backend() == "amd":
                # pylint:disable=import-outside-toplevel
                from lib.plaidml_utils import is_plaidml_error
                if (is_plaidml_error(err) and (
                        "CL_MEM_OBJECT_ALLOCATION_FAILURE" in str(err).upper() or
                        "enough memory for the current schedule" in str(err).lower())):
                    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) Use a more lightweight model, or select the model's 'LowMem' "
                           "option (in config) if it has one.")
                    raise FaceswapError(msg) from err
            raise
 </s> add  </s> remove     freeze_layers=dict(
        default="keras_encoder",
        info="If the command line option 'freeze-weights' is enabled, then the layers indicated "
             "here will be frozen the next time the model starts up. NB: Not all architectures "
             "contain all of the layers listed here, so any layers marked for freezing that are "
             "not within your chosen architecture will be ignored. EG:\n If 'split fc' has "
             "been selected, then 'fc_a' and 'fc_b' are available for freezing. If it has "
             "not been selected then 'fc_both' is available for freezing.",
        datatype=list,
        choices=["encoder", "keras_encoder", "fc_a", "fc_b", "fc_both", "fc_shared", "fc_gblock",
                 "g_block_a", "g_block_b", "g_block_both", "decoder_a", "decoder_b",
                 "decoder_both"],
        group="weights",
        fixed=False),
    load_layers=dict(
        default="encoder",
        info="If the command line option 'load-weights' is populated, then the layers indicated "
             "here will be loaded from the given weights file if starting a new model. NB Not all "
             "architectures contain all of the layers listed here, so any layers marked for "
             "loading that are not within your chosen architecture will be ignored. EG:\n If "
             "'split fc' has been selected, then 'fc_a' and 'fc_b' are available for loading. If "
             "it has not been selected then 'fc_both' is available for loading.",
        datatype=list,
        choices=["encoder", "fc_a", "fc_b", "fc_both", "fc_shared", "fc_gblock", "g_block_a",
                 "g_block_b", "g_block_both", "decoder_a", "decoder_b", "decoder_both"],
        group="weights",
        fixed=True),
 </s> add     "freeze_layers": {
        "default": "keras_encoder",
        "info": (
            "If the command line option 'freeze-weights' is enabled, then the layers indicated "
            "here will be frozen the next time the model starts up. NB: Not all architectures "
            "contain all of the layers listed here, so any layers marked for freezing that are "
            "not within your chosen architecture will be ignored. EG:\n If 'split fc' has "
            "been selected, then 'fc_a' and 'fc_b' are available for freezing. If it has "
            "not been selected then 'fc_both' is available for freezing."),
        "datatype": list,
        "choices": ["encoder", "keras_encoder", "fc_a", "fc_b", "fc_both", "fc_shared",
                    "fc_gblock", "g_block_a", "g_block_b", "g_block_both", "decoder_a",
                    "decoder_b", "decoder_both"],
        "group": "weights",
        "fixed": False},
    "load_layers": {
        "default": "encoder",
        "info": (
            "If the command line option 'load-weights' is populated, then the layers indicated "
            "here will be loaded from the given weights file if starting a new model. NB Not all "
            "architectures contain all of the layers listed here, so any layers marked for "
            "loading that are not within your chosen architecture will be ignored. EG:\n If "
            "'split fc' has been selected, then 'fc_a' and 'fc_b' are available for loading. If "
            "it has not been selected then 'fc_both' is available for loading."),
        "datatype": list,
        "choices": ["encoder", "fc_a", "fc_b", "fc_both", "fc_shared", "fc_gblock", "g_block_a",
                    "g_block_b", "g_block_both", "decoder_a", "decoder_b", "decoder_both"],
        "group": "weights",
        "fixed": True}, </s> remove 
        Notes
        -----
        Clip-norm is ballooning VRAM usage, which is not expected behavior and may be a bug in
        Keras/Tensorflow.

        PlaidML has a bug regarding the clip-norm parameter See:
        https://github.com/plaidml/plaidml/issues/228. We workaround by simply not adding this
        parameter for AMD backend users.
 </s> add 
        self._mixed_precision = self.config["mixed_precision"]
          if self.config["learn_mask"] and self.config["mask_type"] is None:
              raise FaceswapError("'Learn Mask' has been selected but you have not chosen a Mask to "
                                  "use. Please select a mask or disable 'Learn Mask'.")
  
        self._mixed_precision = self.config["mixed_precision"]
          # self._io = IO(self, model_dir, self._is_predict, self.config["save_optimizer"])
          # TODO - Re-enable saving of optimizer once this bug is fixed:
          # File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
          # File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
          # File "h5py/h5d.pyx", line 87, in h5py.h5d.create
keep keep keep keep replace keep keep keep keep keep
 Remove plaidML support (#1325)

* Remove PlaidML reference from readme files

* Remove AMD option from installers

* remove amd requirements and update setup.py

* remove plaidml test from CI workflow

* gpustats: remove plaidml backend

* plaid removals:
  - faceswap.py - python version check
  - setup.cfg - plaidml typing ignore
  - lib.keras_utils - All plaid code
  - lib.launcher.py - All plaidml checks and configuration

* remove tf2.2 specific code from GUI event reader

* lib.model - remove all plaidml implementations

* plugins.extract - remove plaidml code

* plugins.train remove plaidml code

* lib.convert - remove plaidml code

* tools.model: remove plaidml code

* Remove plaidML tests from unit tests

* remove plaidml_utils and docsting cleanups

* Remove plaidML refs from configs

* fix keras imports 
plugins/train/model/_base/model.py