{"record":{"id":"1b8c3c66ee1bf699","repo":"CorentinJ/Real-Time-Voice-Cloning","slug":"no-encoder-models-found-in-s","errorCode":null,"errorMessage":"No encoder models found in %s","messagePattern":"No encoder models found in (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"toolbox/ui.py","lineNumber":338,"sourceCode":"        self.utterance_box.setCurrentIndex(index)\n\n    @property\n    def current_encoder_fpath(self):\n        return self.encoder_box.itemData(self.encoder_box.currentIndex())\n\n    @property\n    def current_synthesizer_fpath(self):\n        return self.synthesizer_box.itemData(self.synthesizer_box.currentIndex())\n\n    @property\n    def current_vocoder_fpath(self):\n        return self.vocoder_box.itemData(self.vocoder_box.currentIndex())\n\n    def populate_models(self, models_dir: Path):\n        # Encoder\n        encoder_fpaths = list(models_dir.glob(\"*/encoder.pt\"))\n        if len(encoder_fpaths) == 0:\n            raise Exception(\"No encoder models found in %s\" % models_dir)\n        self.repopulate_box(self.encoder_box, [(f.parent.name, f) for f in encoder_fpaths])\n\n        # Synthesizer\n        synthesizer_fpaths = list(models_dir.glob(\"*/synthesizer.pt\"))\n        if len(synthesizer_fpaths) == 0:\n            raise Exception(\"No synthesizer models found in %s\" % models_dir)\n        self.repopulate_box(self.synthesizer_box, [(f.parent.name, f) for f in synthesizer_fpaths])\n\n        # Vocoder\n        vocoder_fpaths = list(models_dir.glob(\"*/vocoder.pt\"))\n        vocoder_items = [(f.parent.name, f) for f in vocoder_fpaths] + [(\"Griffin-Lim\", None)]\n        self.repopulate_box(self.vocoder_box, vocoder_items)\n\n    @property\n    def selected_utterance(self):\n        return self.utterance_history.itemData(self.utterance_history.currentIndex())\n\n    def register_utterance(self, utterance: Utterance):","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/CorentinJ/Real-Time-Voice-Cloning/blob/890f3a03187195b9829db2079b75c2ba2ab0405c/toolbox/ui.py#L320-L356","documentation":"Raised by Ui.populate_models (toolbox/ui.py) when models_dir.glob(\"*/encoder.pt\") returns nothing — i.e. no subdirectory of the toolbox models dir contains an encoder.pt. The toolbox requires a trained encoder as a hard dependency (it computes speaker embeddings on every operation), so it refuses to start without one, unlike the vocoder which silently falls back to Griffin-Lim.","triggerScenarios":"Launching demo_toolbox.py with a models dir (default encoder/saved_models) that has no <name>/encoder.pt: pretrained models never downloaded, placed in the wrong subdir, or the -m/--models_root argument pointing elsewhere.","commonSituations":"Fresh clone without downloading the pretrained encoder; putting encoder.pt directly in the models root instead of a named subdirectory; passing the datasets root instead of the models root; training output saved under a different folder name.","solutions":["Download the pretrained encoder and place it so the path is <models_dir>/<model_name>/encoder.pt (per the README's pretrained models instructions).","Check the path you pass: python demo_toolbox.py -m /path/to/models where a subdirectory contains encoder.pt.","If you trained your own encoder, its checkpoint is at encoder/saved_models/<run>/encoder.pt — pass encoder/saved_models as the models root.","Verify with: ls <models_dir>/*/encoder.pt — it must print at least one match."],"exampleFix":"# before\npython demo_toolbox.py -m ~/models  # ls ~/models/*/encoder.pt -> empty -> raises\n\n# after\nmkdir -p ~/models/pretrained && mv ~/Downloads/encoder.pt ~/models/pretrained/\npython demo_toolbox.py -m ~/models  # ~/models/pretrained/encoder.pt now matches the glob","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef encoder_model_present(models_dir: Path) -> bool:\n    return any(models_dir.glob(\"*/encoder.pt\"))","typeGuard":null,"tryCatchPattern":"try:\n    ui.populate_models(models_dir)\nexcept Exception as e:\n    if \"encoder models\" in str(e):\n        raise SystemExit(f\"Missing encoder: place <models>/<name>/encoder.pt (see README pretrained models)\") from e\n    raise","preventionTips":["Add a preflight check in your launcher: any(models_dir.glob('*/encoder.pt')) before starting the toolbox.","Keep a fixed models directory layout: models/<run-name>/{encoder,synthesizer,vocoder}.pt.","Script the pretrained-model download and verify the expected file tree afterwards."],"tags":["toolbox","model-loading","paths","encoder","startup"],"backgroundTag":null,"analyzedSha":"890f3a03187195b9829db2079b75c2ba2ab0405c","analyzedAt":"2026-08-15T02:15:13.202Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}