Skip to content

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

@IannoIITR

Description

@IannoIITR

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions