{"record":{"id":"1d705762fbdf8712","repo":"babysor/MockingBird","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":"models/encoder/data_objects/speaker_verification_dataset.py","lineNumber":15,"sourceCode":"from models.encoder.data_objects.random_cycler import RandomCycler\nfrom models.encoder.data_objects.speaker_batch import SpeakerBatch\nfrom models.encoder.data_objects.speaker import Speaker\nfrom models.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/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/encoder/data_objects/speaker_verification_dataset.py#L1-L33","documentation":"Raised when constructing SpeakerVerificationDataset with a datasets_root that contains no subdirectories: the training data root must hold one directory per (preprocessed) speaker. An empty or flat directory (e.g. pointing at files instead of speaker folders) triggers this exception at dataset construction.","triggerScenarios":"Instantiating SpeakerVerificationDataset(Path) where the path has no immediate subdirectories — e.g. passing the datasets root before encoder preprocessing created per-speaker folders, or passing a speaker's own folder instead of its parent.","commonSituations":"Skipping the encoder_preprocess step; wrong -d/--datasets_root argument (pointing at the wrong level of the tree); preprocessing wrote output elsewhere.","solutions":["Run encoder preprocessing first so per-speaker folders exist under the datasets root","Point datasets_root at the directory whose immediate children are speaker directories (e.g. .../SV2TTS/encoder, not a single speaker folder or the repo root)","Verify with ls that the directory contains one folder per speaker before training"],"exampleFix":"# before\npython encoder_train.py -d datasets/SV2TTS   # no speaker subdirs here\n# after (root containing preprocessed speaker folders)\npython encoder_train.py -d datasets/SV2TTS/encoder","handlingStrategy":"validation","validationCode":"root = Path(datasets_root)\nspeaker_dirs = [f for f in root.glob('*') if f.is_dir()]\nif not speaker_dirs:\n    raise SystemExit(f'{root} has no speaker subdirectories; run encoder_preprocess first')\ndataset = SpeakerVerificationDataset(root)","typeGuard":"def is_valid_datasets_root(root: Path) -> bool:\n    return root.is_dir() and any(f.is_dir() for f in root.glob('*'))","tryCatchPattern":"try:\n    SpeakerVerificationDataset(root)\nexcept Exception as e:\n    raise SystemExit(f'Bad datasets root {root}: {e}') from e","preventionTips":["Always run encoder_preprocess before encoder_train","Point -d at the directory whose children are speaker folders","Sanity-check with ls before long training runs"],"tags":["python","dataset","training","filesystem","encoder"],"backgroundTag":"empty-dataset-directory","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}