From 730365fcdeb70176067d04000f429e0ea22404b5 Mon Sep 17 00:00:00 2001 From: Justin John <34035011+justinjohn0306@users.noreply.github.com> Date: Mon, 27 Feb 2023 10:36:35 +0530 Subject: [PATCH 1/3] Use gloo backend on Windows for Pytorch --- finetune_speaker_v2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/finetune_speaker_v2.py b/finetune_speaker_v2.py index 49ebdd7..85fa044 100644 --- a/finetune_speaker_v2.py +++ b/finetune_speaker_v2.py @@ -65,7 +65,8 @@ def run(rank, n_gpus, hps): writer = SummaryWriter(log_dir=hps.model_dir) writer_eval = SummaryWriter(log_dir=os.path.join(hps.model_dir, "eval")) - dist.init_process_group(backend='nccl', init_method='env://', world_size=n_gpus, rank=rank) + # Use gloo backend on Windows for Pytorch + dist.init_process_group(backend= 'gloo' if os.name == 'nt' else 'nccl', init_method='env://', world_size=n_gpus, rank=rank) torch.manual_seed(hps.train.seed) torch.cuda.set_device(rank) @@ -317,4 +318,4 @@ def evaluate(hps, generator, eval_loader, writer_eval): if __name__ == "__main__": - main() \ No newline at end of file + main() From 3482b9ce5588c2f909e5ab56643afc223e8875bd Mon Sep 17 00:00:00 2001 From: Justin John <34035011+justinjohn0306@users.noreply.github.com> Date: Mon, 27 Feb 2023 11:30:34 +0530 Subject: [PATCH 2/3] downgrade librosa --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 975d78a..bf44056 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Cython -librosa +librosa==0.9.1 numpy scipy tensorboard From b92361b99fd641bc5e1ff0a32e3d5058a3e526c8 Mon Sep 17 00:00:00 2001 From: Exulan <67993175+BushyToaster88@users.noreply.github.com> Date: Fri, 3 Mar 2023 16:17:28 +1100 Subject: [PATCH 3/3] fix-torch-stft-error-on-gpus-sm-53 This pull request addresses an issue that arises when executing the finetune_speaker_v2.py script on GPUs with compute capability less than SM_53. The error occurs at line 104 of mel_processing.py, where the torch.stft() function is called with a half data type. To fix this, I updated the data type to float. --- mel_processing.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mel_processing.py b/mel_processing.py index 96cbb77..8118d5c 100644 --- a/mel_processing.py +++ b/mel_processing.py @@ -101,8 +101,8 @@ def mel_spectrogram_torch(y, n_fft, num_mels, sampling_rate, hop_size, win_size, y = torch.nn.functional.pad(y.unsqueeze(1), (int((n_fft-hop_size)/2), int((n_fft-hop_size)/2)), mode='reflect') 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) + spec = torch.stft(y.float(), 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) spec = torch.sqrt(spec.pow(2).sum(-1) + 1e-6)