santi-pdp / pase

Problem Agnostic Speech Encoder
MIT License
439 stars 87 forks source link

TypeError: ('Unrecognized rnn type: ', 'qrnn') #93

Open delip opened 4 years ago

delip commented 4 years ago

I am following the example set in the README, and I am getting the following error. Is this familiar to anyone?

In [1]: from pase.models.frontend import wf_builder                                                                                            

In [2]: pase = wf_builder('pase_models/cfg/frontend/PASE+.cfg').eval()                                                                         
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-8accba11a31c> in <module>
----> 1 pase = wf_builder('pase_models/cfg/frontend/PASE+.cfg').eval()

/opt/conda/lib/python3.6/site-packages/PASE-0.1.1.dev0-py3.6.egg/pase/models/frontend.py in wf_builder(cfg_path)
     21             with open(cfg_path, 'r') as cfg_f:
     22                 cfg = json.load(cfg_f)
---> 23                 return wf_builder(cfg)
     24         elif isinstance(cfg_path, dict):
     25             if "name" in cfg_path.keys():

/opt/conda/lib/python3.6/site-packages/PASE-0.1.1.dev0-py3.6.egg/pase/models/frontend.py in wf_builder(cfg_path)
     34                     raise TypeError('Unrecognized frontend type: ', model_name)
     35             else:
---> 36                 return WaveFe(**cfg_path)
     37         else:
     38             TypeError('Unexpected config for WaveFe')

/opt/conda/lib/python3.6/site-packages/PASE-0.1.1.dev0-py3.6.egg/pase/models/frontend.py in __init__(self, num_inputs, sincnet, kwidths, strides, dilations, fmaps, norm_type, pad_mode, sr, emb_dim, rnn_dim, activation, rnn_pool, rnn_layers, rnn_dropout, rnn_type, vq_K, vq_beta, vq_gamma, norm_out, tanh_out, resblocks, denseskips, densemerge, name)
    192                                        rnn_type=rnn_type,
    193                                        bidirectional=True,
--> 194                                        dropout=rnn_dropout)
    195             self.W = nn.Conv1d(rnn_dim, emb_dim, 1)
    196         else:

/opt/conda/lib/python3.6/site-packages/PASE-0.1.1.dev0-py3.6.egg/pase/models/modules.py in build_rnn_block(in_size, rnn_size, rnn_layers, rnn_type, bidirectional, dropout, use_cuda)
     57                                             bidirectional=bidirectional)
     58     else:
---> 59         raise TypeError('Unrecognized rnn type: ', rnn_type)
     60     return rnn
     61 

TypeError: ('Unrecognized rnn type: ', 'qrnn')
jcvasquezc commented 4 years ago

I experienced the same error. I think it is something related with the installation of git+https://github.com/salesforce/pytorch-qrnn and cupy-cuda101

delip commented 4 years ago

@jcvasquezc were you able to find a workaround for this?

MittalShruti commented 4 years ago

as @jcvasquezc said, you need to install cupy (your cuda version) + https://github.com/salesforce/pytorch-qrnn

^this resolves the error

santi-pdp commented 4 years ago

Hi @delip , indeed as others correctly point out, you need to install a proper cupy version (in the requirements.txt you'll see the cuda 10.1 version cupy-cuda101, adjust as needed like cupy-cuda100 for your setup ) in addition to the official Pytorch QRNN repo.

delip commented 4 years ago

Thanks, @jcvasquezc, @MittalShruti, and @santi-pdp!

delip commented 4 years ago

I am running into QRNN issues that I've documented here. Is there a recommended commit of the QRNN code that has worked for others?

palashmoon commented 1 month ago

Hi @delip @santi-pdp.. can you pleas help?? i am still getting this error when when i have use cupy-cuda and cudaversion same. Traceback (most recent call last): File "./scripts/feature_extraction/dvlog/extract_audio_pase_embeddings.py", line 49, in pase = wf_builder(args.config_file).to(args.cuda_device).eval() File "/opt/conda/lib/python3.8/site-packages/PASE-0.1.1.dev0-py3.8.egg/pase/models/frontend.py", line 23, in wf_builder File "/opt/conda/lib/python3.8/site-packages/PASE-0.1.1.dev0-py3.8.egg/pase/models/frontend.py", line 36, in wf_builder File "/opt/conda/lib/python3.8/site-packages/PASE-0.1.1.dev0-py3.8.egg/pase/models/frontend.py", line 190, in init File "/opt/conda/lib/python3.8/site-packages/PASE-0.1.1.dev0-py3.8.egg/pase/models/modules.py", line 59, in build_rnn_block TypeError: ('Unrecognized rnn type: ', 'qrnn')