Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspbery Pi 64 / Python 3.9 google.protobuf.message.DecodeError with pypi precise-runner binary #234

Open
ScottMonaghan opened this issue Nov 5, 2022 · 1 comment
Labels

Comments

@ScottMonaghan
Copy link

Describe the bug
I'm porting my working code from Jetson Nano (Debian 18.02, Python 3.6) to Raspberry Pi4 (Debian 20.04, Aarch64, Python 3.9), but I'm getting a google.protobuf.message.DecodeError that prevents the engine from starting.

To get set up quickly I used the binary suggested from the readme.md

Should I try building from source, or is there something easier I'm missing?

To Reproduce

Install process

$ sudo apt install portaudio19-dev python3-pyaudio
$ wget https://github.com/MycroftAI/mycroft-precise/releases/download/v0.3.0/precise-engine_0.3.0_aarch64.tar.gz
$ tar xvf precise-engine_0.3.0_aarch64.tar.gz
$ sudo pip3 install precise-runner
$ wget https://github.com/MycroftAI/precise-data/blob/models/hey-mycroft.pb -P /home/robud/robud/ai/wakeword_detection/models/
$ wget https://github.com/MycroftAI/precise-data/blob/models/hey-mycroft.pb.params -P /home/robud/robud/ai/wakeword_detection/models/

When I run the code below, I get the subsequent error.

    engine = PreciseEngine(PRECISE_EXE_PATH, PRECISE_MODEL_PATH)
    detector = TriggerDetector(CHUNK, SENSITIVITY, TRIGGER_LEVEL)
    engine.start()`

Warning: Failed to load parameters from /home/robud/robud/ai/wakeword_detection/models/hey-mycroft.pb.params
Traceback (most recent call last):
  File "precise/scripts/engine.py", line 64, in <module>
  File "precise/scripts/engine.py", line 52, in main
  File "precise/network_runner.py", line 94, in __init__
  File "precise/network_runner.py", line 43, in __init__
  File "precise/network_runner.py", line 55, in load_graph
  File "google/protobuf/message.py", line 187, in ParseFromString
  File "google/protobuf/internal/python_message.py", line 1145, in MergeFromString
  File "google/protobuf/internal/python_message.py", line 1210, in InternalParse
  File "google/protobuf/internal/decoder.py", line 702, in DecodeRepeatedField
  File "google/protobuf/internal/python_message.py", line 1210, in InternalParse
  File "google/protobuf/internal/decoder.py", line 591, in DecodeField
google.protobuf.message.DecodeError: Truncated string.
[5149] Failed to execute script engine

Environment (please complete the following information):

Additional context
Thank you!

@ScottMonaghan
Copy link
Author

Note: I tried reverting protobuf to 3.7 as noted in requirements.txt but encountered the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant