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

KWS-demo throwing errors on running FastGRNNCUDA inference on google speech commands dataset #241

Open
IannoIITR opened this issue Jul 19, 2021 · 1 comment

Comments

@IannoIITR
Copy link

Error message:-
Exception in thread Thread-1: Traceback (most recent call last): File "/anaconda/envs/spr/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "kws-demo.py", line 151, in run logits = fastgrnn(torch.FloatTensor(features)) File "/anaconda/envs/spr/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__ result = self.forward(*input, **kwargs) File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/noida/code/Users/ian.noronha01/Microsoft/EdgeML/examples/pytorch/FastCells/KWS-training/edgeml_pytorch/trainer/fastmodel.py", line 190, in forward model_output = self.hidden2keyword(model_output[-1, :, :]) File "/anaconda/envs/spr/lib/python3.6/site-packages/torch/nn/modules/module.py", line 532, in __call__ result = self.forward(*input, **kwargs) File "/anaconda/envs/spr/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 87, in forward return F.linear(input, self.weight, self.bias) File "/anaconda/envs/spr/lib/python3.6/site-packages/torch/nn/functional.py", line 1370, in linear ret = torch.addmm(bias, input, weight.t()) RuntimeError: Expected object of device type cuda but got device type cpu for argument #1 'self' in call to _th_addmm

If I run it on a CPU then it throws an error that FastGRNNCUDA is only supported for GPU devices
and using the solution from a previous closed issue #232 throws unexpected layers error
File "kws-demo.py", line 203, in <module> fastgrnn.load_state_dict(torch.load(fastgrnn_model_path, map_location=torch.device('cpu'))) File "/anaconda/envs/spr/lib/python3.6/site-packages/torch/nn/modules/module.py", line 830, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for RNNClassifierModel: Missing key(s) in state_dict: "rnn_list.0.cell.W", "rnn_list.0.cell.U", "rnn_list.0.cell.bias_gate", "rnn_list.0.cell.bias_update", "rnn_list.0.cell.zeta", "rnn_list.0.cell.nu", "rnn_list.0.unrollRNN.RNNCell.W", "rnn_list.0.unrollRNN.RNNCell.U", "rnn_list.0.unrollRNN.RNNCell.bias_gate", "rnn_list.0.unrollRNN.RNNCell.bias_update", "rnn_list.0.unrollRNN.RNNCell.zeta", "rnn_list.0.unrollRNN.RNNCell.nu", "rnn_list.1.cell.W", "rnn_list.1.cell.U", "rnn_list.1.cell.bias_gate", "rnn_list.1.cell.bias_update", "rnn_list.1.cell.zeta", "rnn_list.1.cell.nu", "rnn_l

@ShikharJ
Copy link
Contributor

@SachinG007 Can you please take a look?

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