          FaceswapError
              In the event of a failure to load the weights, or the weights belonging to a different
              model
          """
          retval = get_all_sub_models(load_model(self._weights_file, compile=False))
          if not retval:
              raise FaceswapError(f"Error loading weights file {self._weights_file}.")
  
          if retval[0].name != self._name:
              raise FaceswapError(f"You are attempting to load weights from a '{retval[0].name}' "
 
</s> remove         if len(input_shape) != 4:
            raise ValueError('Inputs should have rank ' +
                             str(4) +
                             '; Received input shape:', str(input_shape))

        if self.data_format == 'channels_first':
            height = None
            width = None
            if input_shape[2] is not None:
                height = input_shape[2] * self.size[0]
            if input_shape[3] is not None:
                width = input_shape[3] * self.size[1]
            channels = input_shape[1] // self.size[0] // self.size[1]

            if channels * self.size[0] * self.size[1] != input_shape[1]:
                raise ValueError('channels of input and size are incompatible')

            retval = (input_shape[0],
                      channels,
                      height,
                      width)
        elif self.data_format == 'channels_last':
            height = None
            width = None
            if input_shape[1] is not None:
                height = input_shape[1] * self.size[0]
            if input_shape[2] is not None:
                width = input_shape[2] * self.size[1]
            channels = input_shape[3] // self.size[0] // self.size[1]

            if channels * self.size[0] * self.size[1] != input_shape[3]:
                raise ValueError('channels of input and size are incompatible')
 </s> add         if self.data_format == 'channels_last':
            pooled = K.min(inputs, axis=[1, 2])
        else:
            pooled = K.min(inputs, axis=[2, 3])
        return pooled </s> remove     def _load(self) -> keras.models.Model:
 </s> add     def _load(self) -> tf.keras.models.Model: </s> remove     :class:`SubPixelUpscaling` layer to speed up the learning process. However, if you are stacking
    multiple :class:`SubPixelUpscaling` blocks, it may increase the number of parameters greatly,
    so the Convolution layer after :class:`SubPixelUpscaling` layer can be removed.
 </s> add     :class:`PixelShuffler` layer to speed up the learning process. However, if you are stacking
    multiple :class:`PixelShuffler` blocks, it may increase the number of parameters greatly,
    so the Convolution layer after :class:`PixelShuffler` layer can be removed. </s> remove     def get_config(self):
 </s> add     def get_config(self) -> dict[str, T.Any]:
        retval = get_all_sub_models(kmodels.load_model(self._weights_file, compile=False))
          FaceswapError
              In the event of a failure to load the weights, or the weights belonging to a different
              model
          """
        retval = get_all_sub_models(kmodels.load_model(self._weights_file, compile=False))
          if not retval:
              raise FaceswapError(f"Error loading weights file {self._weights_file}.")
  
          if retval[0].name != self._name:
              raise FaceswapError(f"You are attempting to load weights from a '{retval[0].name}' "
keep keep keep keep replace keep keep keep keep keep
 Training fixes:
  - Fix mixed precision layer storing and switching
  - typofix in _requirements_base.txt
  - lib.model.layers - cleanup, docs and tests fixes
  - lib.model.nn_blocks - typing fixes 
plugins/train/model/_base/io.py