          model_file = next(fname for fname in os.listdir(model_dir) if fname.endswith(".h5"))
          return os.path.join(model_dir, model_file)
  
      def _parse_weights(self,
                         layer: Union[keras.models.Model, keras.layers.Layer]) -> dict:
          """ Recursively pass through sub-models to scan layer weights"""
          weights = layer.get_weights()
          logger.debug("Processing weights for layer '%s', length: '%s'",
                       layer.name, len(weights))
  
 
</s> remove             klayer: keras.layers.Layer = layer[0]
 </s> add             klayer: tf.keras.layers.Layer = layer[0] </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         policy = dict(class_name="Policy", config=dict(name=dtype))
 </s> add         policy = {"class_name": "Policy", "config": {"name": dtype}} </s> remove             retval = KerasModel(model_inputs, model, name=f"{saved_model.name}_inference")
 </s> add             retval = KModel(model_inputs, model, name=f"{saved_model.name}_inference") </s> remove     def _get_input_shape(self) -> Tuple[int, int, int]:
 </s> add     def _get_input_shape(self) -> T.Tuple[int, int, int]:
                       layer: T.Union[keras.models.Model, keras.layers.Layer]) -> dict:
          model_file = next(fname for fname in os.listdir(model_dir) if fname.endswith(".h5"))
          return os.path.join(model_dir, model_file)
  
      def _parse_weights(self,
                       layer: T.Union[keras.models.Model, keras.layers.Layer]) -> dict:
          """ Recursively pass through sub-models to scan layer weights"""
          weights = layer.get_weights()
          logger.debug("Processing weights for layer '%s', length: '%s'",
                       layer.name, len(weights))
  
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 
tools/model/model.py