RookieJunChen / FullSubNet-plus

The official PyTorch implementation of "FullSubNet+: Channel Attention FullSubNet with Complex Spectrograms for Speech Enhancement".
Apache License 2.0
235 stars 55 forks source link

Fixed torch 2.x bug in torch.istft() #27

Closed nahue-passano closed 4 months ago

nahue-passano commented 5 months ago

Description:

When I wanted to run the repository for the first time I encountered this problem.

File "/home/nahue/dev-personal/FullSubNet-plus/speech_enhance/audio_zen/acoustics/feature.py", line 58, in istft
    return torch.istft(
RuntimeError: istft requires a complex-valued input tensor matching the output from stft with return_complex=True.

It seems to be a bug or a major change in the way torch.istft works when moving from torch to version 2.x. Now, torch.istft only accepts complex input, so I was able to fix the problem and use the code with this modification.

Tests made on:

Processor: Intel® Core™ i5-10210U CPU @ 1.60GHz × 8 OS: Linux Ubuntu 22.04.4 LTS (64 bits) Torch version: 2.2.2