You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuntimeError: stft requires the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release.
#475
Open
finquick opened this issue
Apr 4, 2023
· 3 comments
Today there's an error occurred, what should I do? thanks!
Bug report
Describe the bug
RuntimeError: stft requires the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release.
To Reproduce
import s3prl.hub as hub
import torch
model_0 = getattr(hub, 'fbank')() # use classic FBANK
model_1 = getattr(hub, 'modified_cpc')() # build the CPC model with pre-trained weights
model_2 = getattr(hub, 'tera')() # build the TERA model with pre-trained weights
model_3 = getattr(hub, 'wav2vec2')() # build the Wav2Vec 2.0 model with pre-trained weights
device = 'cpu' # or cpu
model_3 = model_3.to(device)
wavs = [torch.randn(160000, dtype=torch.float).to(device) for _ in range(16)]
with torch.no_grad():
reps = model_3(wavs)["hidden_states"]
Screenshots
If applicable, add screenshots to help explain your problem.
This is due to the upgrade of PyTorch version to 2.0 in Colab, which has caused the issue. Currently, the most direct solution is to downgrade the version to 1.13, which can run normally. Can S3PRL be updated to adapt to PyTorch 2.0?
@dlion168 I've encountered the same bug, I change the code at ./s3prl/s3prl/upstream/baseline/preprocessor.py
add the argument return_complex=False
Then it works
Today there's an error occurred, what should I do? thanks!
Bug report
Describe the bug
RuntimeError: stft requires the return_complex parameter be given for real inputs, and will further require that return_complex=True in a future PyTorch release.
To Reproduce
import s3prl.hub as hub
import torch
model_0 = getattr(hub, 'fbank')() # use classic FBANK
model_1 = getattr(hub, 'modified_cpc')() # build the CPC model with pre-trained weights
model_2 = getattr(hub, 'tera')() # build the TERA model with pre-trained weights
model_3 = getattr(hub, 'wav2vec2')() # build the Wav2Vec 2.0 model with pre-trained weights
device = 'cpu' # or cpu
model_3 = model_3.to(device)
wavs = [torch.randn(160000, dtype=torch.float).to(device) for _ in range(16)]
with torch.no_grad():
reps = model_3(wavs)["hidden_states"]
Screenshots
![image](https://user-images.githubusercontent.com/95392682/229666571-fccf8296-1c9c-40b0-b01b-368b22978a6a.png)
If applicable, add screenshots to help explain your problem.
Environment
colab
pip install s3prl
):!git clone https://github.com/s3prl/s3prl.git
%cd s3prl
!pip install -e .
The text was updated successfully, but these errors were encountered: