From 8ac74c4287b132b22b878363e99017219eceb48e Mon Sep 17 00:00:00 2001 From: TheDevloper2023 <154549023+TheDevloper2023@users.noreply.github.com> Date: Fri, 11 Jul 2025 17:15:58 +0300 Subject: [PATCH 1/4] mel_spectorgram() update for latest pytorch release --- meldataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meldataset.py b/meldataset.py index 44b0bf45a..da5c40d40 100644 --- a/meldataset.py +++ b/meldataset.py @@ -62,7 +62,7 @@ def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, y = y.squeeze(1) spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[str(y.device)], - center=center, pad_mode='reflect', normalized=False, onesided=True) + center=center, pad_mode='reflect', normalized=False, onesided=True, return_complex=True) spec = torch.sqrt(spec.pow(2).sum(-1)+(1e-9)) From 7b3500aed890ec1697d113469d9c770d87b107a3 Mon Sep 17 00:00:00 2001 From: TheDevloper2023 <154549023+TheDevloper2023@users.noreply.github.com> Date: Sat, 12 Jul 2025 09:03:41 +0300 Subject: [PATCH 2/4] update meldataset.py --- meldataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meldataset.py b/meldataset.py index da5c40d40..75c7374b6 100644 --- a/meldataset.py +++ b/meldataset.py @@ -64,7 +64,7 @@ def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[str(y.device)], center=center, pad_mode='reflect', normalized=False, onesided=True, return_complex=True) - spec = torch.sqrt(spec.pow(2).sum(-1)+(1e-9)) + spec = torch.abs(spec) + 1e-9 spec = torch.matmul(mel_basis[str(fmax)+'_'+str(y.device)], spec) spec = spectral_normalize_torch(spec) From 456e37279520e8b38a2689ebdc31761c968a9762 Mon Sep 17 00:00:00 2001 From: TheDevloper2023 <154549023+TheDevloper2023@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:38:11 +0300 Subject: [PATCH 3/4] Update train.py --- train.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/train.py b/train.py index 191c9f478..8930dcd8a 100644 --- a/train.py +++ b/train.py @@ -119,7 +119,11 @@ def train(rank, a, h, warm_start): if h.num_gpus > 1: train_sampler.set_epoch(epoch) - for i, batch in enumerate(train_loader): + processedData = [] + for batch in train_loader: + processedData.append(batch) + + for i, batch in enumerate(processedData): if rank == 0: start_b = time.time() x, y, _, y_mel = batch From 478a7f43a38acf062c535be4caa28312ab402be2 Mon Sep 17 00:00:00 2001 From: TheDevloper2023 <154549023+TheDevloper2023@users.noreply.github.com> Date: Wed, 10 Dec 2025 13:46:44 +0200 Subject: [PATCH 4/4] Fix mel_spectogram for newer pytorch --- meldataset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meldataset.py b/meldataset.py index 450292451..091ca8694 100644 --- a/meldataset.py +++ b/meldataset.py @@ -62,9 +62,9 @@ def mel_spectrogram(y, n_fft, num_mels, sampling_rate, hop_size, win_size, fmin, y = y.squeeze(1) spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[str(y.device)], - center=center, pad_mode='reflect', normalized=False, onesided=True) + center=center, pad_mode='reflect', normalized=False, onesided=True, return_complex=True) - spec = torch.sqrt(spec.pow(2).sum(-1)+(1e-9)) + spec = torch.abs(spec) spec = torch.matmul(mel_basis[str(fmax)+'_'+str(y.device)], spec) spec = spectral_normalize_torch(spec)