AttributeError: 'function' object has no attribute 'keys'
See original GitHub issueWhile running pretrained models tutorial (https://colab.research.google.com/drive/1LN7R3U3xneDgDRK2gC5MzGkLysCWxuC3?usp=sharing) on Google colab I’ve encountered the following error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-21-4ab510a1a511> in <module>()
----> 1 asr_model.modules.keys()
AttributeError: 'function' object has no attribute 'keys'
This occurs after following lines:
from speechbrain.pretrained import EncoderDecoderASR
asr_model = EncoderDecoderASR.from_hparams(source="speechbrain/asr-crdnn-rnnlm-librispeech", savedir="./pretrained_ASR")
asr_model.modules.keys()
Any ideas why it happens?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
AttributeError: 'function' object has no attribute 'keys'
You assign the function load_breast_cancer to the variable data , making the variable data refer to the function load_breast_cancer .
Read more >AttributeError: 'list' object has no attribute 'keys' | bobbyhadz
The Python "AttributeError: 'list' object has no attribute 'keys'" occurs when we call the keys() method on a list instead of a dictionary....
Read more >Dict' Object Has No Attribute 'Key' in Python | Codeigo
The Python error we are discussing here is of AttributeError class. AttributeError generally occurs because an attribute (function object of ...
Read more >AttributeError: 'function' object has no attribute - Databricks
Using protected keywords from the DataFrame API as column names results in a function object has no attribute error message.
Read more >AttributeError: 'list' object has no attribute 'keys' - Reddit
I don't understand why I'm getting this error. I thought the key attributes were 'p_0', 'p_1', 'p_2'.
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 FreeTop 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
Top GitHub Comments
The argument was actually kept as modules, just the internal attribute name was changed. Could add a note in the docstring though-
Ah, the notebook should be changed. We made the
Pretrained
interfaces intotorch.nn.Modules
, which have a.modules()
method. We changed the oldPretrained.modules
attribute toPretrained.mods
.