madhavmk / Noise2Noise-audio_denoising_without_clean_training_data

Source code for the paper titled "Speech Denoising without Clean Training Data: a Noise2Noise Approach". Paper accepted at the INTERSPEECH 2021 conference. This paper tackles the problem of the heavy dependence of clean speech data required by deep learning based audio denoising methods by showing that it is possible to train deep speech denoising networks using only noisy speech samples.
MIT License
172 stars 42 forks source link

STFT requires return_complex = True #7

Closed ashish-nagarse closed 5 months ago

ashish-nagarse commented 1 year ago

I am getting this error

RuntimeError: stft requires the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release.

on running train_losses, test_losses = train(dcunet20, train_loader, test_loader, loss_fn, optimizer, scheduler, 4)

this cell.

I am using pytorch on GPU which support CUDA-11.7 , python-3.11

ashish-nagarse commented 1 year ago

anf after i am specifying return_complex = True in torch.stft(........................ , return_complex = True)

i am getting new error

RuntimeError: Input type (struct c10::complex) and bias type (float) should be the same

ashish-nagarse commented 1 year ago

I am able to run it completely in an env with py-3.8.18 and pytorch-1.10 with cuda-11.3 but It throws error with latest version of pytorch : ) How can i solve those??? I am stuck :) Thank you.

anujstam commented 11 months ago

Looks like by default stft in torch 1.10 has return_complex set to None, so the imaginary terms are stored separately. For newer versions of Torch, you probably need to add torch.view_as_real() as per the documentation after the stft to go from complex to real