pheepa / DCUnet

Phase-aware speech enchancement with Deep Complex U-Net
94 stars 19 forks source link

IndexError: too many indices for tensor of dimension 2 #5

Closed lx2u16 closed 1 year ago

lx2u16 commented 2 years ago

Hi,

Thanks for sharing the nice work.

I have this IndexError: too many indices for tensor of dimension 2 while running pesq_metric = pesq_score(dcunet10, test_loader).

I wonder if you know why?

Best, Lei

Xu-Kaibo commented 1 year ago

The code in this function should be modified a little:

pred_x_16 = torchaudio.transforms.Resample(48000, 16000)(pred_x[i, 0,:].view(1,-1))

pred_x_16 = torchaudio.transforms.Resample(48000, 16000)(pred_x[i, :].view(1,-1))

You can load a sample pair using dataloader and print the size of the speech