'RNN' KeyError
See original GitHub issueNote that this is with the latest commit 12dce88d30cde716cc5ad1ea1af3e618a7c540e7
In [9]: from apex import amp
...: amp_handle = amp.init()
...:
...:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-9-ef5bcdad1b52> in <module>()
1 from apex import amp
----> 2 amp_handle = amp.init()
/opt/conda/lib/python3.6/site-packages/apex-0.1-py3.6.egg/apex/amp/amp.py in init(enabled, enable_caching, verbose, allow_banned)
144
145 # 5.5) Extra-special handling of RNN backend
--> 146 wrap.rnn_cast(torch.nn.backends.thnn.backend, 'RNN', verbose)
147
148 # And even more special handling of `backward` for fused gru / lstm
/opt/conda/lib/python3.6/site-packages/apex-0.1-py3.6.egg/apex/amp/wrap.py in rnn_cast(backend, fn, verbose)
142 # 2) Insert an fp16 `flat_weight` if necessary
143 def rnn_cast(backend, fn, verbose=False):
--> 144 orig_rnn = utils.get_func(backend, fn)
145 @functools.wraps(orig_rnn)
146 def rnn_wrapper(*args, **kwargs):
/opt/conda/lib/python3.6/site-packages/apex-0.1-py3.6.egg/apex/amp/utils.py in get_func(mod, fn)
117 def get_func(mod, fn):
118 if isinstance(mod, torch.nn.backends.backend.FunctionBackend):
--> 119 return mod.function_classes[fn]
120 else:
121 return getattr(mod, fn)
KeyError: 'RNN'
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Training a RNN/LSTM model got KeyError equal to the val of ...
I get the error "KeyError: 60" where actually 60 is the value of the variable "length" (if I change it, the error changes...
Read more >Cryptocurrency ETH USDT prediction with AI RNN V2 - Kaggle
Explore and run machine learning code with Kaggle Notebooks | Using data from Cryptocurrency ETH/USDT Prediction V2.0 AI - RNN.
Read more >Source code for espnet.nets.pytorch_backend.lm.seq_rnn
"""Sequential implementation of Recurrent Neural Network Language Model. ... "RNN_RELU": "relu"}[rnn_type] except KeyError: raise ValueError( "An invalid ...
Read more >StrKeyDict - Jupyter Notebooks Gallery
class StrKeyDict0(dict): def __missing__(self, key): if isinstance(key, str): raise KeyError(key) return self[str(key)] def get(self, key, default=None): ...
Read more >When initialize init_state of rnn (LSTM) with zeros explicitly ...
When initialize init_state of rnn (LSTM) with zeros explicitly , error occurs (KeyError: 'torch.FloatTensor') ... if I don't use en_init_state to ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @mcarilli, I met such RNN key error, so downgraded PyTorch to
e221791
, but still have some problems as:does this work with warp-ctc pytorch binding?
ADDED: sorry. I modified the model output to be casted from half tensor to float tensor, and it seems to work! 😃
Fixed in #41 – @jramapuram, please give the latest code a try!