From 40d72f1131c56c9cb15995aced6cd975e169937e Mon Sep 17 00:00:00 2001 From: yoinked Date: Mon, 3 Apr 2023 13:56:17 -0700 Subject: [PATCH] fix google switching to torch2 colab now uses torch2, so we have to put the return_complex flag; later we'll have to handle when return_complex = True , since it will be forced on --- mel_processing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mel_processing.py b/mel_processing.py index 817f0375..9da68a75 100644 --- a/mel_processing.py +++ b/mel_processing.py @@ -64,7 +64,7 @@ def spectrogram_torch(y, n_fft, sampling_rate, hop_size, win_size, center=False) y = y.squeeze(1) spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[wnsize_dtype_device], - center=center, pad_mode='reflect', normalized=False, onesided=True) + center=center, pad_mode='reflect', normalized=False, onesided=True, return_complex=False) spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6) return spec @@ -102,7 +102,7 @@ def mel_spectrogram_torch(y, n_fft, num_mels, sampling_rate, hop_size, win_size, y = y.squeeze(1) spec = torch.stft(y, n_fft, hop_length=hop_size, win_length=win_size, window=hann_window[wnsize_dtype_device], - center=center, pad_mode='reflect', normalized=False, onesided=True) + center=center, pad_mode='reflect', normalized=False, onesided=True, return_complex=False) spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)