              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]
              logger.info("Updating legacy weights from '%s'...", model_name)
              klayer.set_weights(old_model.get_weights())
          filename = self._io._filename  # pylint:disable=protected-access
          logger.info("Saving Tensorflow 2.x model to '%s'", filename)
          new_model.save(filename)
 
</s> remove             old_model: keras.models.Model = load_model(os.path.join(archive_dir, model_name),
                                                       compile=False)
 </s> add             old_model: tf.keras.models.Model = load_model(os.path.join(archive_dir, model_name),
                                                          compile=False) </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     def _get_input_shape(self) -> Tuple[int, int, int]:
 </s> add     def _get_input_shape(self) -> T.Tuple[int, int, int]: </s> remove         legacy_defaults: Dict[str, Union[str, int, bool]] = dict(centering="legacy",
                                                                 mask_loss_function="mse",
                                                                 l2_reg_term=100,
                                                                 optimizer="adam",
                                                                 mixed_precision=False)
 </s> add         legacy_defaults: T.Dict[str, T.Union[str, int, bool]] = {"centering": "legacy",
                                                                 "mask_loss_function": "mse",
                                                                 "l2_reg_term": 100,
                                                                 "optimizer": "adam",
                                                                 "mixed_precision": False} </s> remove         policy = dict(class_name="Policy", config=dict(name=dtype))
 </s> add         policy = {"class_name": "Policy", "config": {"name": dtype}}
            klayer: tf.keras.layers.Layer = layer[0]
              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: tf.keras.layers.Layer = layer[0]
              logger.info("Updating legacy weights from '%s'...", model_name)
              klayer.set_weights(old_model.get_weights())
          filename = self._io._filename  # pylint:disable=protected-access
          logger.info("Saving Tensorflow 2.x model to '%s'", filename)
          new_model.save(filename)
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