Closed kiyoo1015 closed 5 months ago
%cd /content/open-unmix-pytorch from openunmix import model import torch.nn as nn
stft = model.STFT(n_fft=2048, n_hop=1024) spec = model.Spectrogram(mono=True) transform = nn.Sequential(stft, spec)
x, y = train_dataset[7]
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.
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'
Will check later
%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'