iamsrp/dexter

CreateModel failed with 'Incompatible model.' (0x2003)

Closed this issue · 8 comments

Hi @iamsrp ,
I am trying to run dexter on my Ubuntu 20.04 desktop. I am getting the following error. I am new to this, please guide me about that.

(mypython) deepak@deepak-zebu:~/dexter$ ./dexter.py -c ubuntu_config [2022-07-11 11:21:42,147 MainThread dexter.py:125 INFO] Expanded component inputs:dexter.input.coqui.CoquiInput:model argument from '${HOME}/coqui/model' to '/home/deepak/coqui/model' [2022-07-11 11:21:42,147 MainThread dexter.py:125 INFO] Expanded component inputs:dexter.input.coqui.CoquiInput:scorer argument from '${HOME}/coqui/scorer' to '/home/deepak/coqui/scorer' [2022-07-11 11:21:42,147 MainThread dexter.py:125 INFO] Expanded component services:dexter.service.music.LocalMusicService:dirname argument from '${HOME}/Music' to '/home/deepak/Music' [2022-07-11 11:21:42,207 MainThread coqui.py:63 INFO] Loading model from /home/deepak/coqui/model TensorFlow: v2.3.0-6-g23ad988fcde Coqui STT: v0.10.0-alpha.10-0-g9b517632 Warning: reading entire model file into memory. Transform model file into an mmapped graph to reduce heap usage. 2022-07-11 11:21:42.208228: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. Unable to fetch graph version: Invalid argument: Session was not created with a graph before Run()! Failed to load component dexter.input.coqui.CoquiInput with kwargs {'model': '/home/deepak/coqui/model', 'scorer': '/home/deepak/coqui/scorer'}: CreateModel failed with 'Incompatible model.' (0x2003)
I have downloaded the coqui model and placed in the directory {home}/coqui/model & {home}/coqui/scorer. And i am trying to run ./dexter.py -c ubuntu_config.

When I am running with test_config, I am getting the error below-

[2022-07-11 13:40:59,254 Thread-1 audio.py:317 INFO] Listening [2022-07-11 13:40:59,255 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:40:59,256 Thread-2 audio.py:353 INFO] Decoding audio [2022-07-11 13:40:59,256 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,586 Thread-1 audio.py:252 INFO] Detected start of speech with levels going from 552.00 to 3123.00 [2022-07-11 13:41:02,586 Thread-1 audio.py:281 INFO] Starting recording [2022-07-11 13:41:02,587 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,588 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,589 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,590 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,591 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,592 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,593 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called
it seems it is listening though but it's getting into some error.

The Coqui error is from the core of Coqui itself. It likely depends on where you got the model and scorer from. You can probably just try instantiating the model by doing something like this:

$ ipython3
[...]
In [1]: from stt import Model
In [2]: Model('/home/deepak/coqui/model')
TensorFlow: v2.8.0-8-g06c8fea58fd
 Coqui STT: v1.3.0-0-g148fa743
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
Out[2]: <stt.Model at 0x7f1ddf92f880>

and see if it just works. If so then we can look to dig deeper. If not then you might have to poke about in the Coqui documentation and check to make sure you have the right model etc.

FWIW I have these:

$ ls -l
total 3180
drwxrwsr-x 2 srp srp    4096 Feb 26 11:50 English_STT_v1.0.0-huge-vocab/
drwxrwsr-x 2 srp srp    4096 Feb 26 14:39 English_STT_v1.0.0-large-vocab/

and am currently using the "huge" one (in the example above):

$ ls -l
total 8
lrwxrwxrwx 1 srp srp 80 Feb 26 14:44 model -> /home/srp/downloads/speech2text/coqui/English_STT_v1.0.0-huge-vocab/model.tflite
lrwxrwxrwx 1 srp srp 90 Feb 26 14:44 scorer -> /home/srp/downloads/speech2text/coqui/English_STT_v1.0.0-huge-vocab/huge-vocabulary.scorer

Though the "tflite" version of the model.

Thanks for the flag about the test_config I'll try to look at that too. I've not messed with it in a while and it might have suffered bitrot..

srp

Hmm, weird. Thetest_config works for me. Are you sure you're using the vanilla version of it?

srp

==

$ ./dexter.py -c test_config 
[2022-07-11 19:34:21,279 MainThread __init__.py:390 INFO] Starting the system
[2022-07-11 19:34:21,279 MainThread __init__.py:455 INFO] Starting SocketInput[Listening on *:8008]
[2022-07-11 19:34:21,279 MainThread socket.py:61 INFO] Opening socket on port 8008
[2022-07-11 19:34:21,280 MainThread __init__.py:455 INFO] Starting LogOutput
[2022-07-11 19:34:21,280 MainThread __init__.py:455 INFO] Starting EchoService
[2022-07-11 19:34:21,280 MainThread __init__.py:455 INFO] Starting MatchService
[2022-07-11 19:34:21,280 MainThread __init__.py:393 INFO] Entering main loop
^C[2022-07-11 19:34:22,775 MainThread __init__.py:433 WARNING] KeyboardInterrupt received
[2022-07-11 19:34:22,775 MainThread __init__.py:437 INFO] Stopping the system
[2022-07-11 19:34:22,775 MainThread __init__.py:474 INFO] Stopping SocketInput[Listening on *:8008]
[2022-07-11 19:34:22,775 MainThread __init__.py:474 INFO] Stopping LogOutput
[2022-07-11 19:34:22,775 MainThread __init__.py:474 INFO] Stopping EchoService
[2022-07-11 19:34:22,775 MainThread __init__.py:474 INFO] Stopping MatchService
$ 

Hey @iamsrp,
I made a few changes to the test config file. LIke changing the socket input to audio input as follows:

` "inputs" : [
[ "dexter.input.audio.AudioInput", {

        }] `

With this change, I see that the code is listening to the stuff I speak. However, I get the following error message:

[2022-07-11 13:41:02,587 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,588 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,589 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,590 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,591 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,592 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called [2022-07-11 13:41:02,593 Thread-2 audio.py:379 ERROR] Got an error in the decoder queue: Abstract method called

I tried to get feedback from STDOUT using
` "outputs" : [
[ "dexter.output.io.LogOutput", {
"level" : "INFO"
}],
[ "dexter.output.io.StdoutOutput", {

        }]
    ], `

but it was throwing me the following error:
Failed to load component dexter.output.io.StdoutOutput with kwargs {}: name 'Stdout' is not defined

I want to use a microphone connected to my computer and get some sort of text feedback to start with. Let me know how to fix the above-mentioned issues.
How can I change it to use Vosk and what path should I have the vosk models along with any other info I may need.
Thanks!

Thanks for flagging the Stdout bug, I pushed a fix. Let me know if it doesn't work.

For Vosk, you should just be able to do this:

            [ "dexter.input.vosk.VoskInput", {
                "model"   : "${HOME}/vosk/model"
            }]

where I have:

$ d ~/vosk
total 8
lrwxrwxrwx 1 pi pi    9 Dec 26  2021 model -> model.big/
lrwxrwxrwx 1 pi pi   21 Dec 20  2021 model.big -> vosk-model-en-us-0.22/
lrwxrwxrwx 1 pi pi   27 Dec 20  2021 model.small -> vosk-model-small-en-us-0.15/
drwxr-xr-x 8 pi pi 4096 Dec 26  2021 vosk-model-en-us-0.22/
drwxr-xr-x 6 pi pi 4096 Dec 26  2021 vosk-model-small-en-us-0.15/

on my Pi4.

And, yes, you can't use AudioInput like that; it's an abstract class, and the basis of the other classes which use Vosk, Coqui, DeepSpeech, etc. You need to use one of the concrete subclasses.

Finally, you can also try adding the simple (debugging) SocketInput:

            [ "dexter.input.socket.SocketInput", {
                "port"   : "8008",
                "prefix" : "Dexter"
            }]

and then:

$ telnet localhost 8008

to try it out. Note that there is no security on that and that anyone can just connect to it, so don't use it on an untrusted network etc. (Not that folks can do much aside from mess with your Dexter instance, but still...)

Hope this helps,

srp

Hi,

It looks like the latest release of Coqui is out and that it works with the current Pi OS release. You should be able to retry with the Coqui models now I think.

srp

Let me know if there is anything pending here. If not then I'll close it out.

srp

So closing.