Voice Assistant Tutorial

Following the tutorial (How to build a voice assistant with open source Rasa and Mozilla tools) and I can successfully record audio to a .wav file (on a mac). However, I then get the following error:

* recording
* done recording
Traceback (most recent call last):
  File "transcribe.py", line 58, in <module>
    predicted_text = deepspeech_predict(WAVE_OUTPUT_FILENAME)
  File "transcribe.py", line 51, in deepspeech_predict
    ds = Model('deepspeech-0.5.1-models/output_graph.pbmm', N_FEATURES, N_CONTEXT, 'deepspeech-0.5.1-models/alphabet.txt', BEAM_WIDTH)
  File "/usr/local/lib/python3.7/site-packages/deepspeech/__init__.py", line 40, in __init__
    status, impl = deepspeech.impl.CreateModel(*args, **kwargs)
TypeError: CreateModel() takes at most 2 arguments (5 given)

I do see - Successfully installed deepspeech-0.6.1 so I’m wondering if it is a version mismatch problem since the tutorial is geared for 0.5.1 ?

1 Like

hey @jonathanpwheat, you are correct it’s the problem of version mismatch. it happened with me when I upgraded the deepspeech and the model to version 0.6. I see the CreateModel() arguments were changed the in the newer version.

In version 0.5.1, it was :

Model(‘deepspeech-0.5.1-models/output_graph.pbmm’, N_FEATURES, N_CONTEXT, ‘deepspeech-0.5.1-models/alphabet.txt’, BEAM_WIDTH)

and in version 0.6, it’s this way:

https://github.com/mozilla/DeepSpeech-examples/blob/bbac85cc465ad5e68dfc0e365ef1485465db96af/mic_vad_streaming/mic_vad_streaming.py#L164

so better we use version 0.5 :sweat_smile:

1 Like

Thanks, this is what I ended up doing to get it working.

pip3 uninstall deepspeech pip3 install -Iv deepspeech==0.5.1

-Jon

1 Like

This is fun. I did all of the above on my mac. Today I’m trying on a windows machine and when I run the install statement above I get a love note:

ERROR: No matching distribution found for deepspeech==0.5.1

Update: looks like it comes down to a Python 3.7 issue. DeepSpeech doesn’t have a 3.7 package.

I’ll downgrade python in Anaconda and see if that works… Or update the code to use the current 6.x version of DeepSpeech :slight_smile:

1 Like

I’ve upgraded the code to use the latest everything, Python, Rasa, DeepSpeech 0.6.1

@Emma - is me somehow updating the blog post possible? or commenting on it with changes? Or should I write my own tutorial using current versions (Python / Rasa / DeepSpeech, etc) and have you link to it?

2 Likes

Hi @jonathanpwheat

Thank you so much for offering to help us update this, especially since it’s something our community is very interested in!

We’re currently discussing the best way to approach it and will get back to you in the upcoming days with clearer next steps. :slight_smile:

2 Likes

Hey @jonathanpwheat,

Sorry for the lack of reply here, we are still discussing this and I wanted to let you know before the weekend that we should have more info next week.

1 Like

No worries, take your time :slight_smile:

1 Like

Hey… I have deepspeech version 0.5.1 and I have been following the same blog which is mentioned above but after running this command **rasa run --enable-api -p 5005** i am getting this error

TypeError: CreateModel() takes at most 2 arguments (5 given)

what changes are needed for me to remove this error. @JiteshGaikwad @jonathanpwheat @Emma Please help.

Hey @Abbas, I think so there is some version problem of DeepSpeech that you are using or the model. Can you please recheck the Deepspeech version and model version of DeepSpeech that you are using?

ok

@JiteshGaikwad I have been using this version TensorFlow: v1.14.0-21-ge77504a DeepSpeech: v0.6.1-0-g3df20fe

Sorry it was my mistake i have been using deepspeech version 0.6.1 not 0.5.1 now what are the changes i need to follow for this version of deepspeech could you please guide.

You just need to downgrade the Deepspeech version to 0.5.1 and use the 0.5.1 model, it will solve the error.

1 Like

ok let me try that

@JiteshGaikwad now it shows this after hitting command rasa run --enable-api -p 5005

Hey @Abbas, it’s a warning since you are using the older models but as of that models will work, no need to worry about that but if you want to get rid of that warning you can change the model names as suggested there, you can check this sampel config.yml file contents:

Hey @JiteshGaikwad did what u suggested but still not working, still with that same error.

I hope you are aware that i am talking about this error in the above screen shot

E tensorflow/stream_executor/cuda/cuda_driver.cc:351] failed call to cuInit: UNKNOWN ERROR (303)

Hey @Abbas, this error appears when you don’t have CUDA enabled system but still you train and run your bot, are you facing any issues for training the bot, can you share the screenshot of error you are getting other than the above error?

no @JiteshGaikwad thats the only issue which i am facing, error is in above image

Ya so you can train and test your bot?