              scaling = self._parallel_scaling.get(num_plugins, self._scaling_fallback)
              required = sum(self._vram_per_phase[p] for p in current_phase + [phase]) * scaling
              logger.debug("Num plugins for phase: %s, scaling: %s, vram required: %s",
                           num_plugins, scaling, required)
              if required <= available and not force_single_process:
                  logger.debug("Required: %s, available: %s. Adding phase '%s' to current phase: %s",
                               required, available, phase, current_phase)
                  current_phase.append(phase)
              elif len(current_phase) == 0 or force_single_process:
                  # Amount of VRAM required to run a single plugin is greater than available. We add
 
</s> remove         kwargs = dict(in_queue=self._queues[in_qname], out_queue=self._queues[out_qname])
 </s> add         kwargs = {"in_queue": self._queues[in_qname], "out_queue": self._queues[out_qname]} </s> remove     def _rewrite_plaid_outputs(self) -> None:
        """ Rewrite the output names for models using the PlaidML (Keras 2.2.4) backend

        Keras 2.2.4 duplicates model output names if any of the models have multiple outputs
        so we need to rename the outputs so we can successfully map the loss dictionaries.

        This is a bit of a hack, but it does work.
        """
        # TODO Remove this rewrite code if PlaidML updates to a version of Keras where this is
        # no longer necessary
        if len(self.model.output_names) == len(set(self.model.output_names)):
            logger.debug("Output names are unique, not rewriting: %s", self.model.output_names)
            return
        seen = {name: 0 for name in set(self.model.output_names)}
        new_names = []
        for name in self.model.output_names:
            new_names.append(f"{name}_{seen[name]}")
            seen[name] += 1
        logger.debug("Output names rewritten: (old: %s, new: %s)",
                     self.model.output_names, new_names)
        self.model.output_names = new_names

    def _legacy_mapping(self) -> Optional[dict]:
 </s> add     def _legacy_mapping(self) -> T.Optional[dict]: </s> remove             The output of this function must be a keras model generated from
            :class:`plugins.train.model._base.KerasModel`. See Keras documentation for the correct
            structure, but note that parameter :attr:`name` is a required rather than an optional
            argument in Faceswap. You should assign this to the attribute ``self.name`` that is
            automatically generated from the plugin's filename.
 </s> add             See Keras documentation for the correct structure, but note that parameter :attr:`name`
            is a required rather than an optional argument in Faceswap. You should assign this to
            the attribute ``self.name`` that is automatically generated from the plugin's filename. </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             The output of this function must be a keras model generated from
            :class:`plugins.train.model._base.KerasModel`. See Keras documentation for the correct
            structure, but note that parameter :attr:`name` is a required rather than an optional
            argument in Faceswap. You should assign this to the attribute ``self.name`` that is
            automatically generated from the plugin's filename.
 </s> add             The generated model
            if required <= available and multiprocess:
              scaling = self._parallel_scaling.get(num_plugins, self._scaling_fallback)
              required = sum(self._vram_per_phase[p] for p in current_phase + [phase]) * scaling
              logger.debug("Num plugins for phase: %s, scaling: %s, vram required: %s",
                           num_plugins, scaling, required)
            if required <= available and multiprocess:
                  logger.debug("Required: %s, available: %s. Adding phase '%s' to current phase: %s",
                               required, available, phase, current_phase)
                  current_phase.append(phase)
              elif len(current_phase) == 0 or force_single_process:
                  # Amount of VRAM required to run a single plugin is greater than available. We add
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/extract/pipeline.py