{"record":{"id":"ce3c253bcf47095d","repo":"deepfakes/faceswap","slug":"there-are-multiple-plugin-types-p-types-stor","errorCode":null,"errorMessage":"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","messagePattern":"There are multiple plugin types \\('(.+?)'\\) stored in the model folder '(.+?)'\\. This is not supported\\.\\\\nPlease split the model files into their own folders before proceeding","errorType":"exception","errorClass":"FaceswapError","httpStatus":null,"severity":"error","filePath":"plugins/train/model/_base/model.py","lineNumber":188,"sourceCode":"        FaceswapError\n            If multiple model files, or models for a different plugin from that requested exists\n            within the model folder\n        \"\"\"\n        multiple_models = self._io.multiple_models_in_folder\n        if multiple_models is None:\n            logger.debug(\"Contents of model folder are valid\")\n            return\n\n        if len(multiple_models) == 1:\n            msg = (f\"You have requested to train with the '{self.name}' plugin, but a model file \"\n                   f\"for the '{multiple_models[0]}' plugin already exists in the folder \"\n                   f\"'{self.io.model_dir}'.\\nPlease select a different model folder.\")\n        else:\n            p_types = \"', '\".join(multiple_models)\n            msg = (f\"There are multiple plugin types ('{p_types}') stored in the model folder '\"\n                   f\"{self.io.model_dir}'. This is not supported.\\nPlease split the model files \"\n                   \"into their own folders before proceeding\")\n        raise FaceswapError(msg)\n\n    def build(self) -> None:\n        \"\"\"Build the model and assign to :attr:`model`.\n\n        Within the defined strategy scope, either builds the model from scratch or loads an\n        existing model if one exists.\n\n        If running inference, then the model is built only for the required side to perform the\n        swap function, otherwise  the model is then compiled with the optimizer and chosen\n        loss function(s).\n\n        Finally, a model summary is outputted to the logger at verbose level.\n        \"\"\"\n        is_summary = hasattr(self._args, \"summary\") and self._args.summary\n        if self._io.model_exists:\n            model = self.io.load()\n            if self._is_predict:\n                inference = Inference(model, self._args.swap_model)","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/deepfakes/faceswap/blob/f530cb7508ae670f6474f8a7d9c4df94705cf96b/plugins/train/model/_base/model.py#L170-L206","documentation":"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.","triggerScenarios":"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.","commonSituations":"User consolidates backups into one folder, restores from an archive that merged runs, or switches trainers twice while reusing the same directory.","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"],"exampleFix":"# before: /models/mixed contains dlight_state.h5 + original_state.h5\n# error: multiple plugin types\n\n# after (shell)\nmkdir /models/dlight /models/original\nmv /models/mixed/dlight* /models/dlight/\nmv /models/mixed/original* /models/original/\npython faceswap.py train -t dlight -m /models/dlight","handlingStrategy":"validation","validationCode":"import os, collections\nplugins = collections.Counter(\n    f.rsplit(\"_\", 1)[0] for f in os.listdir(model_dir) if f.endswith(\"_state.h5\")\n)\nif len(plugins) > 1:\n    raise SystemExit(f\"Mixed plugin files in model dir: {dict(plugins)} - split them first\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never manually merge model files from different trainings into one folder","When restoring backups, restore whole folders, not individual files into a shared directory"],"tags":["faceswap","training","model-folder","filesystem"],"backgroundTag":null,"analyzedSha":"f530cb7508ae670f6474f8a7d9c4df94705cf96b","analyzedAt":"2026-08-15T02:59:26.626Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}