mirror of https://github.com/coqui-ai/TTS.git
data loader fix
This commit is contained in:
parent
33937f54d0
commit
b1beb1f876
|
@ -98,6 +98,12 @@ class LJSpeechDataset(Dataset):
|
||||||
mel = [self.ap.melspectrogram(w).astype('float32') for w in wav]
|
mel = [self.ap.melspectrogram(w).astype('float32') for w in wav]
|
||||||
mel_lengths = [m.shape[1] for m in mel]
|
mel_lengths = [m.shape[1] for m in mel]
|
||||||
|
|
||||||
|
# compute 'stop token' targets
|
||||||
|
stop_targets = [np.array([0.]*mel_len) for mel_len in mel_lengths]
|
||||||
|
|
||||||
|
# PAD stop targets
|
||||||
|
stop_targets = prepare_stop_target(stop_targets, self.outputs_per_step)
|
||||||
|
|
||||||
# PAD sequences with largest length of the batch
|
# PAD sequences with largest length of the batch
|
||||||
text = prepare_data(text).astype(np.int32)
|
text = prepare_data(text).astype(np.int32)
|
||||||
wav = prepare_data(wav)
|
wav = prepare_data(wav)
|
||||||
|
@ -121,12 +127,6 @@ class LJSpeechDataset(Dataset):
|
||||||
# update mel lengths
|
# update mel lengths
|
||||||
mel_lengths = [l+pad_len for l in mel_lengths]
|
mel_lengths = [l+pad_len for l in mel_lengths]
|
||||||
|
|
||||||
# compute 'stop token' targets
|
|
||||||
stop_targets = [np.array([0.]*mel_len) for mel_len in mel_lengths]
|
|
||||||
|
|
||||||
# PAD stop targets
|
|
||||||
stop_targets = prepare_stop_target(stop_targets, self.outputs_per_step)
|
|
||||||
|
|
||||||
# B x T x D
|
# B x T x D
|
||||||
linear = linear.transpose(0, 2, 1)
|
linear = linear.transpose(0, 2, 1)
|
||||||
mel = mel.transpose(0, 2, 1)
|
mel = mel.transpose(0, 2, 1)
|
||||||
|
|
Loading…
Reference in New Issue