Skip to content

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

@ScottMonaghan

Description

@ScottMonaghan

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions