mirror of https://github.com/coqui-ai/TTS.git
proper error message for when num_speakers is set too low
This commit is contained in:
parent
05ff8801d1
commit
765597e983
7
train.py
7
train.py
|
@ -108,6 +108,13 @@ def train(model, criterion, criterion_st, optimizer, optimizer_st, scheduler,
|
||||||
speaker_ids.append(speaker_mapping[speaker_name])
|
speaker_ids.append(speaker_mapping[speaker_name])
|
||||||
speaker_ids = torch.LongTensor(speaker_ids)
|
speaker_ids = torch.LongTensor(speaker_ids)
|
||||||
|
|
||||||
|
if len(speaker_mapping) > c.num_speakers:
|
||||||
|
raise ValueError("It seems there are at least {} speakers in "
|
||||||
|
"your dataset, while 'num_speakers' is set to {}. "
|
||||||
|
"Found the following speakers: {}".format(len(speaker_mapping),
|
||||||
|
c.num_speakers,
|
||||||
|
list(speaker_mapping)))
|
||||||
|
|
||||||
# set stop targets view, we predict a single stop token per r frames prediction
|
# set stop targets view, we predict a single stop token per r frames prediction
|
||||||
stop_targets = stop_targets.view(text_input.shape[0],
|
stop_targets = stop_targets.view(text_input.shape[0],
|
||||||
stop_targets.size(1) // c.r, -1)
|
stop_targets.size(1) // c.r, -1)
|
||||||
|
|
Loading…
Reference in New Issue