speechbrain foreign_class AttributeError
See original GitHub issueHello,
I’m trying to run the following code:
from speechbrain.pretrained.interfaces import foreign_class
classifier = foreign_class(source="speechbrain/emotion-recognition-wav2vec2-IEMOCAP", pymodule_file="custom_interface.py", classname="CustomEncoderWav2vec2Classifier")
And I get the following error:
emotion_detection.py 8 <module> classifier = foreign_class(source=“speechbrain/emotion-recognition-wav2vec2-IEMOCAP”,
interfaces.py 97 foreign_class hparams = load_hyperpyyaml(fin, overrides)
core.py 189 load_hyperpyyaml removal_keys = [k for k in hparams.keys() if k.startswith(“__”)]
AttributeError: ‘str’ object has no attribute ‘keys’
AttributeError: 'str' object has no attribute 'keys'
I tried all possible ways to try to solve this issue. I even re-installed python 3.9 and all the dependencies. I tried to install speechbrain via pip and github, and the installation process did not throw any exceptions. However, I just cannot get the code to run.
I was able to get it run on another computer and I did exactly what I did here. I don’t understand what happened … can anyone give me a hint?
Thank you so much!
Issue Analytics
- State:
- Created a year ago
- Comments:11
Top GitHub Comments
Hello @lindagaw,
It’s good news that you successfully solved the issue!
No worries 😃
Hello Adel-Moumen,
I got the module running by deleting the wav2vec2_checkpoints and pretrained_models folders.
Thank you for your help and I’m so sorry for all the trouble!
Best, lindagaw