ruizhecao96 / CMGAN

Conformer-based Metric GAN for speech enhancement
MIT License
309 stars 60 forks source link

RuntimeeError #36

Open Litchi1999 opened 1 year ago

Litchi1999 commented 1 year ago

istft requires a complex-valued input tensor matching the output from stft with return_complex=True.

samly97 commented 1 year ago

I set return_complex=False and added the following lines after the power_uncompress and before the iSTFT call:

        est_spec_uncompress = est_spec_uncompress.permute(0, 3, 1, 2)
        est_spec_real = est_spec_uncompress[:, 0, :, :]
        est_spec_imag = est_spec_uncompress[:, 1, :, :]
        est_spec_uncompress = torch.complex(est_spec_real, est_spec_imag)