pase icon indicating copy to clipboard operation
pase copied to clipboard

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

Open delip opened this issue 4 years ago • 8 comments

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')

delip avatar Mar 17 '20 05:03 delip

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

jcvasquezc avatar Mar 17 '20 13:03 jcvasquezc

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

delip avatar Mar 17 '20 18:03 delip

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

^this resolves the error

MittalShruti avatar Mar 18 '20 01:03 MittalShruti

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.

santi-pdp avatar Mar 18 '20 04:03 santi-pdp

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

delip avatar Mar 20 '20 22:03 delip

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?

delip avatar Mar 21 '20 00:03 delip