RustAudio / deepspeech-rs

Rust bindings for the deepspeech library
Other
295 stars 24 forks source link

Could not run example: ERROR: Could not open 'deepspeech-0.8.0-models.tflite/output_graph.pb' #35

Closed antholeole closed 3 years ago

antholeole commented 4 years ago

The quickstart guide says to download the models from the release announcement which, unless I'm downloading the wrong thing, looks like a file called "deepspeech-0.8.0-models.tflite" or "deepspeech-0.8.0-models.pbmm". When running the command the quickstart guide recommends,cargo run --release --example client <path-to-model-dir> <path-to-audio-file>the process fails with

ERROR: Could not open '/<PATH>/deepspeech-0.8.0-models.tflite/output_graph.pb'.
Error at reading model file '/<PATH>/deepspeech-0.8.0-models.tflite/output_graph.pb

(Where <PATH> is the path to the file, in my case in a directory on my desktop)

I'm using deepspeech from commit hash f94b98d429bdac30b9b9aaa048946537b6ebd575 as the current (as of Aug 10, 2020) project does not compile. (I chalk this up to currently being in migration of a rename from DeepSpeech to STT and a lot of the variables are not yet renamed to STT.)

I see this is due to an api change between the models, where previously (0.6.x) models were in a zipped package. I will see if I can update examples/client.rs working using the new API and submit a PR to fix it - I've not done anything with TF in the past, so not sure how clean my results will be.

est31 commented 4 years ago

Thanks for the report. In older releases, pretrained models were distributed as a zip file but now apparently the bare files are distributed. The loading code has to be adjusted and take files instead of directories.

When making the release I haven't tried out loading the models and running it, unlike with earlier releases. This is the reason why the bug went out unnoticed. Maybe the CI should be adjusted to do it, but that's a separate issue.

antholeole commented 4 years ago

No problem - thanks for the awesome package! I didn't end up working on the PR because I'm hesitant to make changes on an older commit while I wait for package to switch to the "STT" rename.

est31 commented 4 years ago

I've created a new branch for the 0.8 release: https://github.com/RustAudio/deepspeech-rs/commits/0.8

est31 commented 4 years ago

You can make a PR against that branch :).

nihiluis commented 3 years ago

Are the examples updated for 0.9.x? There's no output_graph.pbmm to download.

lissyx commented 3 years ago

Are the examples updated for 0.9.x? There's no output_graph.pbmm to download.

https://github.com/mozilla/DeepSpeech/releases/tag/v0.9.3 has deepspeech-0.9.3-models.pbmm