deepfakes/faceswap · error · FaceswapError
There are multiple plugin types ('{p_types}') stored in the
Error message
There are multiple plugin types ('{p_types}') stored in the model folder '{self.io.model_dir}'. This is not supported.\nPlease split the model files into their own folders before proceeding What it means
FaceswapError raised by ModelBase._check_multiple_models() when the model folder contains state/model files from two or more different plugin types (e.g. both original and dlight files). Faceswap cannot decide which model to load and does not support mixing architectures in one folder. The message lists the offending plugin types found.
Source
Thrown at plugins/train/model/_base/model.py:188
FaceswapError
If multiple model files, or models for a different plugin from that requested exists
within the model folder
"""
multiple_models = self._io.multiple_models_in_folder
if multiple_models is None:
logger.debug("Contents of model folder are valid")
return
if len(multiple_models) == 1:
msg = (f"You have requested to train with the '{self.name}' plugin, but a model file "
f"for the '{multiple_models[0]}' plugin already exists in the folder "
f"'{self.io.model_dir}'.\nPlease select a different model folder.")
else:
p_types = "', '".join(multiple_models)
msg = (f"There are multiple plugin types ('{p_types}') stored in the model folder '"
f"{self.io.model_dir}'. This is not supported.\nPlease split the model files "
"into their own folders before proceeding")
raise FaceswapError(msg)
def build(self) -> None:
"""Build the model and assign to :attr:`model`.
Within the defined strategy scope, either builds the model from scratch or loads an
existing model if one exists.
If running inference, then the model is built only for the required side to perform the
swap function, otherwise the model is then compiled with the optimizer and chosen
loss function(s).
Finally, a model summary is outputted to the logger at verbose level.
"""
is_summary = hasattr(self._args, "summary") and self._args.summary
if self._io.model_exists:
model = self.io.load()
if self._is_predict:
inference = Inference(model, self._args.swap_model)View on GitHub (pinned to f530cb7508)
Solutions
- Sort the files in the folder by plugin name and move each plugin's files (state file, weights, h5/keras files) into its own subfolder
- Point -m at the cleaned folder for the plugin you want and restart training
- If unsure which files belong together, check the plugin name embedded in each state filename before splitting
Example fix
# before: /models/mixed contains dlight_state.h5 + original_state.h5 # error: multiple plugin types # after (shell) mkdir /models/dlight /models/original mv /models/mixed/dlight* /models/dlight/ mv /models/mixed/original* /models/original/ python faceswap.py train -t dlight -m /models/dlight
Defensive patterns
Strategy: validation
Validate before calling
import os, collections
plugins = collections.Counter(
f.rsplit("_", 1)[0] for f in os.listdir(model_dir) if f.endswith("_state.h5")
)
if len(plugins) > 1:
raise SystemExit(f"Mixed plugin files in model dir: {dict(plugins)} - split them first") Prevention
- Never manually merge model files from different trainings into one folder
- When restoring backups, restore whole folders, not individual files into a shared directory
When it happens
Trigger: Launching training with -m pointing at a folder where files like original_state.h5 and phaze_a_state.h5 (or equivalent per-plugin files) coexist. Happens after manually copying model files from several trainings into one directory.
Common situations: User consolidates backups into one folder, restores from an archive that merged runs, or switches trainers twice while reusing the same directory.
Related errors
- You have requested to train with the '{self.name}' plugin, b
- You have selected the mask type '{mask_type}' but at least o
- '{method}' is not a valid clipping method. Select from {list
- '{name}' is not a valid optimizer. Select from {list(_OPTIMI
- You do not have enough GPU memory available to train the sel
AI-assisted analysis of deepfakes/faceswap@f530cb7508 (2026-08-15).
Data as JSON: /api/errors/ce3c253bcf47095d.
Report an issue: GitHub.