{"record":{"id":"19be54ddfa3cafb8","repo":"deepfakes/faceswap","slug":"name-is-not-a-valid-plugin-type-plugin-select","errorCode":null,"errorMessage":"{name} is not a valid {plugin_type} plugin. Select from {mods}","messagePattern":"(.+?) is not a valid (.+?) plugin\\. Select from (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"plugins/plugin_loader.py","lineNumber":105,"sourceCode":"            The name of the requested extractor plugin\n\n        Returns\n        -------\n        An extraction plugin\n\n        Raises\n        ------\n        ValueError\n            If an invalid plugin type or plugin name is selected\n        \"\"\"\n        if plugin_type not in cls.extract_plugins:\n            raise ValueError(f\"{plugin_type} is not a valid plugin type. Select from \"\n                             f\"{list(cls.extract_plugins)}\")\n        plugins = cls.extract_plugins[plugin_type]\n        mods = [p.split(\".\")[-2] for p in plugins]\n        real_name = name.lower().replace(\"-\", \"_\")\n        if real_name not in mods:\n            raise ValueError(f\"{name} is not a valid {plugin_type} plugin. Select from {mods}\")\n\n        mod, obj = plugins[mods.index(real_name)].rsplit(\".\", maxsplit=1)\n        logger.debug(\"Loading '%s' from '%s'\", plugin_type, name)\n\n        module = import_module(mod)\n\n        retval = getattr(module, obj)()\n        logger.info(\"Loading %s from %s\", plugin_type.title(), retval.name)\n        return retval\n\n    @staticmethod\n    def get_model(name: str, disable_logging: bool = False) -> type[ModelBase]:\n        \"\"\"Return requested training model plugin\n\n        Parameters\n        ----------\n        name\n            The name of the requested training model plugin","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/deepfakes/faceswap/blob/f530cb7508ae670f6474f8a7d9c4df94705cf96b/plugins/plugin_loader.py#L87-L123","documentation":"Raised by PluginLoader.get_extractor after the type check passes but the requested plugin name (lower-cased, hyphens converted to underscores) is not among the discovered modules for that type. The module list is built from the files present in the plugins/extract/<type>/ folder, so a name that is not shipped (or not found on disk) fails here.","triggerScenarios":"Requesting e.g. get_extractor('detect', 'retina-mobile') when only s3fd/mtcnn/etc. modules exist; passing a plugin name from a different Faceswap version or a third-party plugin that was not installed into the plugins folder.","commonSituations":"Tutorials referencing plugins that no longer exist or were renamed; custom plugin file not placed in plugins/extract/<type>/; typos or wrong case/hyphenation in the name.","solutions":["Pick a name from the list printed in the error message (mods for that type).","If using a third-party plugin, install its module file into the correct plugins/extract/<type>/ directory.","Spell the name as shipped — hyphens and underscores are normalized, but the word itself must match the module folder."],"exampleFix":"# before\nplugin = PluginLoader.get_extractor('align', 'dlib')\n\n# after\nplugin = PluginLoader.get_extractor('align', 'fan')  # a shipped aligner","handlingStrategy":"type-guard","validationCode":"from plugins.plugin_loader import PluginLoader\nmods = [p.split(\".\")[-2] for p in PluginLoader.extract_plugins[\"detect\"]]\nassert \"s3fd\" in mods, f\"pick from {mods}\"","typeGuard":"def is_valid_plugin(name: str, ptype: str) -> bool:\n    from plugins.plugin_loader import PluginLoader\n    mods = [p.split(\".\")[-2] for p in PluginLoader.extract_plugins[ptype]]\n    return name.lower().replace(\"-\", \"_\") in mods","tryCatchPattern":null,"preventionTips":["Enumerate available plugins with PluginLoader.get_available_extract_plugins before requesting one by name.","Install third-party plugin modules into the correct plugins/extract/<type>/ directory before referencing them."],"tags":["faceswap","plugin-loader","api-misuse","validation"],"backgroundTag":null,"analyzedSha":"f530cb7508ae670f6474f8a7d9c4df94705cf96b","analyzedAt":"2026-08-15T02:59:26.626Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}