Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when i run inference.py script an error occurs #15

Open
ghost opened this issue Aug 2, 2023 · 2 comments
Open

when i run inference.py script an error occurs #15

ghost opened this issue Aug 2, 2023 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 2, 2023

2023-08-02 12:00:07.518068: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT /usr/local/lib/python3.10/dist-packages/torch/functional.py:641: UserWarning: stft with return_complex=False is deprecated. In a future pytorch release, stft will return complex tensors for all inputs, and return_complex=False will raise an error. Note: you can still call torch.view_as_real on the complex output to recover the old return format. (Triggered internally at ../aten/src/ATen/native/SpectralOps.cpp:862.) return _VF.stft(input, n_fft, hop_length, win_length, window, # type: ignore[attr-defined] Traceback (most recent call last): File "/content/nuwave2/inference.py", line 115, in wav_recon, wav_list = model.inference(wav_l, band, args.steps, noise_schedule) File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/content/nuwave2/lightning_model.py", line 50, in inference signal, recon = self.model.denoise_ddim(signal, wav_l, band, logsnr_t, logsnr_s) File "/content/nuwave2/diffusion.py", line 54, in denoise_ddim noise = self.model(y, y_l, band, norm_nlogsnr) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/content/nuwave2/model.py", line 215, in forward x, skip_connection = layer(x, band, noise_level) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/content/nuwave2/model.py", line 173, in forward y_l, y_g = self.ffc1(y_l, y_g, band) # STFC File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/content/nuwave2/model.py", line 153, in forward out_xg = self.convl2g(x_l) + self.convg2g(x_g, band) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/content/nuwave2/model.py", line 125, in forward output = self.fu(x, band) File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/content/nuwave2/model.py", line 105, in forward output = torch.istft(ffted, self.n_fft, hop_length=self.hop_size, win_length=self.win_size, window=self.hann_window,
RuntimeError: istft requires a complex-valued input tensor matching the output from stft with return_complex=True.

Please any one can resolve this issue for me , thanks in advance

@youyouta123
Copy link

I also encountered the same problem. Have you solved it?

@youhjjhhhjj
Copy link

it's caused by the pytorch version

fix by putting torch.view_as_complex(ffted) on line 105 of model.py
will also need to uncomment return_complex=False on utils/stft.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants