sigsep / open-unmix-pytorch

Open-Unmix - Music Source Separation for PyTorch
https://sigsep.github.io/open-unmix/
MIT License
1.24k stars 181 forks source link

There was a problem running the openunmix tutorial in colab!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #129

Closed kiyoo1015 closed 5 months ago

kiyoo1015 commented 1 year ago

%cd /content/open-unmix-pytorch from openunmix import model import torch.nn as nn

/content/open-unmix-pytorch/openunmix

create a spectrogram layer

stft = model.STFT(n_fft=2048, n_hop=1024) spec = model.Spectrogram(mono=True) transform = nn.Sequential(stft, spec)

x, y = train_dataset[7]

transform the time domain input to spectrograms

X = transform(x[None]) Y = transform(y[None])

f, axes = plt.subplots(1, 2) axes[0].pcolormesh(np.log(X[:, 0, 0, :].detach().numpy().T + 1)) axes[1].pcolormesh(np.log(Y[:, 0, 0, :].detach().numpy().T + 1))

display(Audio(x, rate=44100)) display(Audio(y, rate=44100))

When I executed the above code, the following error occurred. want to know why stft doesn't attribute.

/content/open-unmix-pytorch

AttributeError Traceback (most recent call last) in 5 # create a spectrogram layer 6 ----> 7 stft = model.STFT(n_fft=2048, n_hop=1024) 8 spec = model.Spectrogram(mono=True) 9 transform = nn.Sequential(stft, spec)

AttributeError: module 'openunmix.model' has no attribute 'STFT'

faroit commented 1 year ago

Will check later