#Wake word model generation failing at last step (conversion .onnx to .tflite)

1 messages · Page 1 of 1 (latest)

rough tusk
#

Hi Everyone!

I was trying to follow the instructions at https://www.home-assistant.io/voice_control/create_wake_word/ to create a custom wakeword.

I used the Colab playbook linked in the above instruction page: https://colab.research.google.com/drive/1q1oe2zOyZp7UsB3jJiQ1IFn8z5YfjwEb?usp=sharing#scrollTo=1cbqBebHXjFD

It all works fine, however at the very last step (converting onnx to tflite) it fails with a statement that it can't find tensorflow. I'm surprised, because it used tensorflow in previous steps. I think this converter function needs a really old version of tensorflow though (according to the AI helper it's 2.8.1) and this seems to be no longer available in PIP.

Does anyone know how to fix this? A screenshot of the error is attached to this post.

PS: I could download the .onnx file but of course I need the .tflite. I've looked at other options too in converting onnx to tflite but they all seem deprecated and/or requiring really old versions of tools that are no longer available 😦

I also tried some low-hanging fruit like !pip install tensorflow and then running the command manually in a new code block but this ran into all sorts of problems too.

Home Assistant

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

#

Wake word model generation failing at last step (conversion .onnx to .tflite)

lucid latch
#

Same problem for me. If I look at the Download Data execution, I see the following lines which makes it seem like tensorflow is being uninstalled

iron fable
#

Tensorflow libraries and their dependents and what python version they are compatible with can be a pain in the ass. My guess is there is some dependency weirdness and it can’t resolve them all (note it installed one version of tensorflow and was looking for another one)

#

But yes was running into the same issues and also roadblocks using various local onnx to tf solutions which might be the easiest if anyone knows an easy solution there

rough tusk
#

Yeah I was looking at the same thing @iron fable but I ran into the same issue. They are all using weird combos of really old versions of python libs and there's always one or two that are not supported 😦

#

And one of them I kinda got running but then tensorflow kept trying to use CUDA even though I have a ROCm GPU. I tried several ways of forcing it to use CPU (which I found on slackoverflow) but it kept giving CUDA errors.

rough tusk
#

Hey so I just found this one: https://colab.research.google.com/drive/1yyFH-fpguX2BTAW8wSQxTrJnJTM-0QAd?usp=sharing. It's supposed to be more elaborate! And you can repeat the last step if it fails. Not sure if that will do anything. But I will give it a try when I get a chance (not right now as it's saturday night). Will let you know here tomorrow.

The only thing I'm missing in this colab script is where to actually put the new wakeword 🧐 Edit: Ah it's where it says "hey sebastian". It's in the middle and doesn't have an audio preview like the other workbook.

PS: This was from https://github.com/dscripka/openWakeWord?tab=readme-ov-file#training-new-models

#

@iron fable also

rough tusk
#

Maybe it's even possible to just do the last step

rough tusk
#

Ok no the other workbook has the same issue 😦

#

But after I install it with pip install tensorflow==2.17.1 (as it did before), I get another error:

#

I don't really understand what it means by these arg specs not matching

#

And if I remove the line that generates this error (it's raised by the script itself), I do indeed get a deeper error so there was a reason for that.

#

So grm, not sure where to go now. This whole toolchain is not something I understand

rough tusk
rough tusk
#

Ahh but then I found this was all for nothing because this is for openwakeword and the voice preview uses microwakeword. 😦

rough tusk
#

Reading more about this that microwakeword is pretty nifty

sudden talon
rough tusk
#

Yeah it's probably a lot harder to get it right because of the low processing power on an ESP32

#

I wonder if I just train it with say 100 samples of my own voice, would that work? It would be fine if it only works for me. In fact that would be better even

#

The piper voices sound nothing like my own so it's not surprising that doesn't work well

#

But it doesn't have to work for the whole world 🙂

#

But I think it's especially nifty because it doesn't require streaming all my audio to home assistant all of the time. That's very good. Much better for privacy