{"record":{"id":"ce5f3e38964c057f","repo":"CorentinJ/Real-Time-Voice-Cloning","slug":"no-speakers-found-make-sure-you-are-pointing-to-t","errorCode":null,"errorMessage":"No speakers found. Make sure you are pointing to the directory containing all preprocessed speaker directories.","messagePattern":"No speakers found\\. Make sure you are pointing to the directory containing all preprocessed speaker directories\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"encoder/data_objects/speaker_verification_dataset.py","lineNumber":15,"sourceCode":"from encoder.data_objects.random_cycler import RandomCycler\nfrom encoder.data_objects.speaker_batch import SpeakerBatch\nfrom encoder.data_objects.speaker import Speaker\nfrom encoder.params_data import partials_n_frames\nfrom torch.utils.data import Dataset, DataLoader\nfrom pathlib import Path\n\n# TODO: improve with a pool of speakers for data efficiency\n\nclass SpeakerVerificationDataset(Dataset):\n    def __init__(self, datasets_root: Path):\n        self.root = datasets_root\n        speaker_dirs = [f for f in self.root.glob(\"*\") if f.is_dir()]\n        if len(speaker_dirs) == 0:\n            raise Exception(\"No speakers found. Make sure you are pointing to the directory \"\n                            \"containing all preprocessed speaker directories.\")\n        self.speakers = [Speaker(speaker_dir) for speaker_dir in speaker_dirs]\n        self.speaker_cycler = RandomCycler(self.speakers)\n\n    def __len__(self):\n        return int(1e10)\n        \n    def __getitem__(self, index):\n        return next(self.speaker_cycler)\n    \n    def get_logs(self):\n        log_string = \"\"\n        for log_fpath in self.root.glob(\"*.txt\"):\n            with log_fpath.open(\"r\") as log_file:\n                log_string += \"\".join(log_file.readlines())\n        return log_string\n    \n    ","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/CorentinJ/Real-Time-Voice-Cloning/blob/890f3a03187195b9829db2079b75c2ba2ab0405c/encoder/data_objects/speaker_verification_dataset.py#L1-L33","documentation":"Raised by SpeakerVerificationDataset.__init__ (encoder/data_objects/speaker_verification_dataset.py) when datasets_root/* contains no subdirectories. The dataset expects the layout produced by encoder_preprocess.py: <datasets_root>/SV2TTS/encoder/<speaker_name>/... — it globs exactly one level of directories and each must be a preprocessed speaker folder (with _sources.txt and frame .npy files).","triggerScenarios":"Calling SpeakerVerificationDataset(Path(...)) (typically via encoder_train.py with a --datasets_root argument) where the path is wrong, points at the raw dataset instead of the preprocessed SV2TTS/encoder output, is one level too high/low, or the preprocessing script never ran/produced nothing.","commonSituations":"Passing the raw LibraSpeech/other corpus root instead of <root>/SV2TTS/encoder; forgetting to run encoder_preprocess.py first; a typo or missing mount of the datasets_root; running encoder_train.py with the default path in a fresh checkout.","solutions":["Run preprocessing first: python encoder_preprocess.py -d <dataset> -i <datasets_root>, then train with the same -i value (encoder_train.py derives <root>/SV2TTS/encoder itself).","Verify the layout: ls <datasets_root>/SV2TTS/encoder should show one directory per speaker, each containing _sources.txt and *.npy files.","Check the path spelling/level — the constructor needs the directory whose direct children are speaker folders.","If data lives elsewhere, symlink speaker directories into <datasets_root>/SV2TTS/encoder/."],"exampleFix":"# before\ntrain_dataset = SpeakerVerificationDataset(Path(\"~/datasets/LibriSpeech\"))  # raw corpus, no speaker subdirs -> raises\n\n# after\ntrain_dataset = SpeakerVerificationDataset(Path(\"~/datasets\").expanduser().joinpath(\"SV2TTS\", \"encoder\"))","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef assert_preprocessed_root(datasets_root: Path):\n    enc_root = datasets_root / \"SV2TTS\" / \"encoder\"\n    speakers = [d for d in enc_root.glob(\"*\") if d.is_dir()]\n    assert speakers, f\"No speaker dirs in {enc_root} — run encoder_preprocess.py first\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair encoder_train.py with the same -i root used for encoder_preprocess.py.","Check for <root>/SV2TTS/encoder/<speaker>/_sources.txt before training; that file is the preprocessing marker.","Automate the layout check in a preflight script so path typos fail in seconds, not after data loading."],"tags":["data","training","encoder","paths","preprocessing"],"backgroundTag":null,"analyzedSha":"890f3a03187195b9829db2079b75c2ba2ab0405c","analyzedAt":"2026-08-15T02:15:13.202Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}