          os.rename(self.model_dir, archive_dir)
          os.mkdir(self.model_dir)
          new_model = self.build_model(self._get_inputs())
          for model_name, layer_name in legacy_mapping.items():
              old_model: keras.models.Model = load_model(os.path.join(archive_dir, model_name),
                                                         compile=False)
              layer = [layer for layer in new_model.layers if layer.name == layer_name]
              if not layer:
                  logger.warning("Skipping legacy weights from '%s'...", model_name)
                  continue
              klayer: keras.layers.Layer = layer[0]
 
</s> remove             klayer: keras.layers.Layer = layer[0]
 </s> add             klayer: tf.keras.layers.Layer = layer[0] </s> remove                        layer: Union[keras.models.Model, keras.layers.Layer]) -> dict:
 </s> add                        layer: T.Union[keras.models.Model, keras.layers.Layer]) -> dict: </s> remove         policy = dict(class_name="Policy", config=dict(name=dtype))
 </s> add         policy = {"class_name": "Policy", "config": {"name": dtype}} </s> remove     def _get_input_shape(self) -> Tuple[int, int, int]:
 </s> add     def _get_input_shape(self) -> T.Tuple[int, int, int]: </s> remove         masks3: Union[List[np.ndarray], np.ndarray] = []
 </s> add         masks3: T.Union[T.List[np.ndarray], np.ndarray] = []
            old_model: tf.keras.models.Model = load_model(os.path.join(archive_dir, model_name),
                                                          compile=False)
          os.rename(self.model_dir, archive_dir)
          os.mkdir(self.model_dir)
          new_model = self.build_model(self._get_inputs())
          for model_name, layer_name in legacy_mapping.items():
            old_model: tf.keras.models.Model = load_model(os.path.join(archive_dir, model_name),
                                                          compile=False)
            old_model: tf.keras.models.Model = load_model(os.path.join(archive_dir, model_name),
                                                          compile=False)
              layer = [layer for layer in new_model.layers if layer.name == layer_name]
              if not layer:
                  logger.warning("Skipping legacy weights from '%s'...", model_name)
                  continue
              klayer: keras.layers.Layer = layer[0]
keep keep keep keep replace 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