CorentinJ/Real-Time-Voice-Cloning · critical · Exception
No speakers found. Make sure you are pointing to the directo
Error message
No speakers found. Make sure you are pointing to the directory containing all preprocessed speaker directories.
What it means
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).
Source
Thrown at encoder/data_objects/speaker_verification_dataset.py:15
from encoder.data_objects.random_cycler import RandomCycler
from encoder.data_objects.speaker_batch import SpeakerBatch
from encoder.data_objects.speaker import Speaker
from encoder.params_data import partials_n_frames
from torch.utils.data import Dataset, DataLoader
from pathlib import Path
# TODO: improve with a pool of speakers for data efficiency
class SpeakerVerificationDataset(Dataset):
def __init__(self, datasets_root: Path):
self.root = datasets_root
speaker_dirs = [f for f in self.root.glob("*") if f.is_dir()]
if len(speaker_dirs) == 0:
raise Exception("No speakers found. Make sure you are pointing to the directory "
"containing all preprocessed speaker directories.")
self.speakers = [Speaker(speaker_dir) for speaker_dir in speaker_dirs]
self.speaker_cycler = RandomCycler(self.speakers)
def __len__(self):
return int(1e10)
def __getitem__(self, index):
return next(self.speaker_cycler)
def get_logs(self):
log_string = ""
for log_fpath in self.root.glob("*.txt"):
with log_fpath.open("r") as log_file:
log_string += "".join(log_file.readlines())
return log_string
View on GitHub (pinned to 890f3a0318)
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/.
Example fix
# before
train_dataset = SpeakerVerificationDataset(Path("~/datasets/LibriSpeech")) # raw corpus, no speaker subdirs -> raises
# after
train_dataset = SpeakerVerificationDataset(Path("~/datasets").expanduser().joinpath("SV2TTS", "encoder")) Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
def assert_preprocessed_root(datasets_root: Path):
enc_root = datasets_root / "SV2TTS" / "encoder"
speakers = [d for d in enc_root.glob("*") if d.is_dir()]
assert speakers, f"No speaker dirs in {enc_root} — run encoder_preprocess.py first" Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Can't create RandomCycler from an empty collection
- No encoder models found in %s
- Both increase only and decrease only are set
- Model was not loaded. Call load_model() before inference.
- No visdom server detected. Run the command \"visdom\" in you
AI-assisted analysis of CorentinJ/Real-Time-Voice-Cloning@890f3a0318 (2026-08-15).
Data as JSON: /api/errors/ce5f3e38964c057f.
Report an issue: GitHub.