Wake word not working with precise

I next tried this one and put “mycroft-precise==0.20” into requirements.txt as suggested. Got error when I ran dev_setup.sh. I noticed before that precise was ver 0.2.0 so I changed requirements.txt to that ver and the setup succeeded. However, the result did not change. I will not use precise and when forced it will not respond. Don’t give up on me. :slight_smile:
Ron

Just updated the stuff on the laptop to investigate.

13:53:42.725 - mycroft.client.speech.hotword_factory:on_download:191 - INFO - Downloading Precise executable...

13:53:47.728 - mycroft.client.speech.hotword_factory:during_download:203 - INFO - Still downloading executable…
13:53:48.407 - mycroft.client.speech.hotword_factory:initialize:281 - ERROR - Could not create hotword. Falling back to default.
Traceback (most recent call last):
File “/home/peter/mycroft-core/mycroft/client/speech/hotword_factory.py”, line 269, in initialize
instance = clazz(hotword, config, lang=lang)
File “/home/peter/mycroft-core/mycroft/client/speech/hotword_factory.py”, line 132, in init
precise_exe = self.install_exe(precise_config[‘dist_url’])
File “/home/peter/mycroft-core/mycroft/client/speech/hotword_factory.py”, line 164, in install_exe
on_download=self.on_download, on_complete=self.on_complete
File “/home/peter/mycroft-core/.venv/lib/python3.6/site-packages/petact/petact.py”, line 121, in install_package
download_extract_tar(tar_url, folder, data_file)
File “/home/peter/mycroft-core/.venv/lib/python3.6/site-packages/petact/petact.py”, line 83, in download_extract_tar
tar.extractall(path=folder)
File “/usr/lib/python3.6/tarfile.py”, line 2008, in extractall
numeric_owner=numeric_owner)
File “/usr/lib/python3.6/tarfile.py”, line 2050, in extract
numeric_owner=numeric_owner)
File “/usr/lib/python3.6/tarfile.py”, line 2120, in _extract_member
self.makefile(tarinfo, targetpath)
File “/usr/lib/python3.6/tarfile.py”, line 2169, in makefile
copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
File “/usr/lib/python3.6/tarfile.py”, line 249, in copyfileobj
buf = src.read(bufsize)
File “/usr/lib/python3.6/gzip.py”, line 276, in read
return self._buffer.read(size)
File “/usr/lib/python3.6/_compression.py”, line 68, in readinto
data = self.read(len(byte_view))
File “/usr/lib/python3.6/gzip.py”, line 482, in read
raise EOFError("Compressed file ended before the "
EOFError: Compressed file ended before the end-of-stream marker was reached

So it looks like the “precise-data” binary tar.gz is either corrupt or the download makes it corrupt.

Manually deleted precise-engine files, redownloaded by mycroft but clould not extract the package. Manually extracted the package, but still no luck.

These items appear in the logs

Exception in thread Thread-34:
Traceback (most recent call last):
 File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
   self.run()
 File “/usr/lib/python3.6/threading.py”, line 864, in run
   self._target(*self._args, **self._kwargs)
 File “/home/peter/mycroft-core/.venv/lib/python3.6/site-packages/precise_runner/runner.py”, line 197, in _handle_predictions
   prob = self.engine.get_prediction(chunk)
 File “/home/peter/mycroft-core/.venv/lib/python3.6/site-packages/precise_runner/runner.py”, line 65, in get_prediction
   return float(self.proc.stdout.readline())
ValueError: could not convert string to float:  

Exception in thread Thread-28:
Traceback (most recent call last):
 File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
   self.run()
 File “/usr/lib/python3.6/threading.py”, line 864, in run
   self._target(*self._args, **self._kwargs)
 File “/home/peter/mycroft-core/.venv/lib/python3.6/site-packages/precise_runner/runner.py”, line 197, in _handle_predictions
   prob = self.engine.get_prediction(chunk)
 File “/home/peter/mycroft-core/.venv/lib/python3.6/site-packages/precise_runner/runner.py”, line 64, in get_prediction
   self.proc.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe

Exception in thread Thread-16:
Traceback (most recent call last):
 File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
   self.run()
 File “/usr/lib/python3.6/threading.py”, line 864, in run
   self._target(*self._args, **self._kwargs)
 File “/home/peter/mycroft-core/.venv/lib/python3.6/site-packages/precise_runner/runner.py”, line 197, in _handle_predictions
   prob = self.engine.get_prediction(chunk)
 File “/home/peter/mycroft-core/.venv/lib/python3.6/site-packages/precise_runner/runner.py”, line 64, in get_prediction
   self.proc.stdin.flush()
BrokenPipeError: [Errno 32] Broken pipe

Ah, apologies for the typo, that was poor of me.

Well, we at least know that Precise is installed, but I don’t know why precise-runner did not install it properly. The issue is not just on your machine, I had the same issue here on Ubuntu 18.04 LTS so it’s more widespread. My log analysis didn’t show anything obvious I’m afraid.

But let’s turn our attention to why Precise is not activating properly for you. You’ve confirmed that you’re using the Default Wake Word of Hey Mycroft, so it’s unlikely to be a custom Wake Word setting issue (more information on setting a custom Wake Word here).

We’re definitely not going to give up on you :wink:

Are you comfortable telling me;

  • Do you have a strong accent at all (I grew up in Northumbria so totally understand Pitmatic, Geordie, and Mackem, not so good with the West Country ones :wink:
  • It may be that we don’t have enough samples of your particular accent for Mycroft to “recognise” your utterance of Hey Mycroft as the Wake Word. Are you opted in to our open dataset?

Best, Kathy

@KathyReid “precise-runner” downloads the proper “precise-data” binary, but fails to properly extract the archive. Because of that, it fails to finish the “set to precise” process. Configuration wise it however says the listener is set to precise however, because the process is not properly finished Mycroft ends up in sort sort of “in the middle state”.

My guess, however not confirmed yet is that Debian based systems updated some of the tar / gzip packages and therefor the python bindings to it have changed and are bugged at the moment.

Perhaps updating the python packages that are handling the tar / gzip process needs updating.

Or python itself got updated or something.

Great leads, thanks @j1nx - did this show up in a log file / terminal output somewhere? I’m guessing it was part of the mycroft-core install and I just missed it…

Those snippets are from the voice.log as precise is logged to that part of mycroft.

Yeah the trick is that precise-runner is failing to install precise-data, but this failure does not show up in voice.log. I think I need to closely watch a Linux install from scratch and see if I can see the failure, possibly pipe stdout to a file for later examination. Will report back.

I know you are further along in the problem but to answer your question, no I do not have an accent
and have no problem with other SR pkgs. Mycroft with pocketsphinx works just fine. Not so well on
a custom wake word which is why I would like to use precise.

Ron

So, the problem we’re trying to solve now that Precise is installed, is why it’s not recognising your voice when you say the Wake Word. Is it still falling back to PocketSphinx or is it trying to use Precise to hear the Wake Word and not recognising it?

Can you show me your current log output / screenshot of the CLI?

(Sorry to go over old ground, I just want to make sure we’re diagnosing from the right spot)

I thought the problem was determined to be that precise-runner is failing to install precise-data. In any case below is the log with my comments in '()'s. I have to be away from my office for a few days so I will not be able to provide more debug info directly but will be able to answer any questions and continue in the discussion.

Ron


what listener

The listener is pocket sphinx.
hey mycroft (audible invoke of “hey mycroft” works with pocketsphinx)
change listener too precise

Downloading the new listener, this will take a bit and you won’t
be able to use me until it completes. Give me a minute before
attempting to activate me again.

— Log Output
08:51:33.410 - main:handle_wakeword:56 - INFO - Wakeword Detected: hey mycroft
08:51:34.776 - main:handle_utterance:61 - INFO - Utterance: [‘change listener too precise’]
08:51:36.238 - mycroft.client.speech.listener:create_wake_word_recognizer:243 - INFO - creating wake word engine
08:51:36.239 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading “hey mycroft” wake word via precise
08:51:38.246 - mycroft.client.speech.listener:create_wakeup_recognizer:263 - INFO - creating stand up word engine
08:51:38.247 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading “wake up” wake word via pocketsphinx
08:51:40.407 - mycroft.client.speech.listener:create_wake_word_recognizer:243 - INFO - creating wake word engine
08:51:40.408 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading “hey mycroft” wake word via precise
08:51:41.476 - mycroft.client.speech.listener:create_wakeup_recognizer:263 - INFO - creating stand up word engine
08:51:41.478 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading “wake up” wake word via pocketsphinx
08:53:58.897 - mycroft.client.speech.listener:create_wake_word_recognizer:243 - INFO - creating wake word engine
08:53:58.898 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading “hey mycroft” wake word via pocketsphinx
08:53:58.929 - mycroft.client.speech.listener:create_wakeup_recognizer:263 - INFO - creating stand up word engine
08:53:58.930 - mycroft.client.speech.hotword_factory:load_module:261 - INFO - Loading “wake up” wake word via pocketsphinx
— Log Output end

(wait 5 minutes)
what listener

The listener is set to precise.

(no response for “hey mycroft” wake phrase)
(When I type in “what listener” I get:)

The current listener is precise.

Thanks for that @Ron777, I also think you manually installed Precise if I recall.

I honestly don’t know what’s going on here, I’m going to ping my colleague @Wolfgange on this one to see if he has any ideas on the best way to diagnose this one.

At one point I did manually install precise but not sure if available to this vir env. I do not
work much with python or the vir env
stuff so not sure if it is using that one or other. Anyway, have you had luck with a fresh install
on a ubuntu 16 or 18 system yet? I am happy to uninstall things and do a fresh
install (not OS). But that will probably not happen till next Monday as I am away from my system this
week. But I am excited about using your stuff with my research work here at Bell Labs. And
I would like to work with you all to extend it possibly. Right now just skunk works. Thanks
again for your help, I am sure you are working a thousand issues at once.

Ron

I am back and still trying to get mycroft running on ubuntu 16.04 on x86_64. Just in case something changed (for the better) I reinstalled mycroft per instructions and ran it. Unfortunately now I can not even pair the device as it failed to connect to mycroft when I ran start-mycroft.sh debug . I am able to ping mycroft.ai so the computer can get to the host. I even tried on a different computer which I did not update and it could not get to mycroft.ai. I do not see anyone else having this problem. Any ideas? Thanks.

Ron

Have you tried saying pair my device or typing pair my device onto the CLI?
It definitely sounds like an issue in that the device hasn’t been paired with home.mycroft.ai yet.

Yes, I have done this many times before and it automatically does the pairing and I put the code into the website and all is good. Now when it tries to pair or when I type in “pair my device” I get the response:

Connection to mycroft dot a.i, failed,
pairing code could not be fetched. Check your
internet connection and try again.
When I exit and try to ping mycroft.ai I get ping results back so my computer can access mycroft.ai.
Ron

Ok, it seems to work not. I just left it running and after many tries it connected. Maybe it was too busy before. Anyway that is back working now. Now back to see why precise does not work. I have an idea I am working on and will get back to you today.

1 Like

Seems to work “now”. A mistype.

May have a reason for the problem with precise. I installed precise manually and tried to train a new wake word. I got an invalid instruction error. I posted my problem and Matthew Scholdfield was nice enough to help. It seems my xeon processor does not support AVX extensions which Matthew says tensorflow requires. I reverted to an earlier version of tensorflow and the error went away (still did not work well but I link that to problems with inconsistent versions). I do not know if the precise commands used by mycroft require tensorflow. Perhaps it is failing silently making precise go away without mycroft sw realizing. Or for some reason it works (might drop back to earlier version) but it is incompatible with hey-mycroft model. Can you find out if mycroft uses tensorflow when invoking precise? It is possible precise only uses tensorflow when training in which case it should not be a problem with mycroft use. I tried reverting to tensorflow 1.5 as I did with precise test but I got no dif results. Unfortunately I do not have a processor which supports AVX to try out mycroft. Not sure how RPI gets away with this as it does not support AVX but perhaps the RPI version works around that. I am using ubuntu on x86_64 processors.

No worries, thanks for confirming @Ron777