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

nodejs package deepspeech crashes (using node v16.0.0) #3642

Closed
solyarisoftware opened this issue May 3, 2021 · 3 comments
Closed

nodejs package deepspeech crashes (using node v16.0.0) #3642

solyarisoftware opened this issue May 3, 2021 · 3 comments

Comments

@solyarisoftware
Copy link

My program: deepSpeechTranscriptNative.js, part of a simple project DeepSpeechJs I made to use/test DeepSpeech nodejs bindings APIs, crashes when using latest nodejs version.
Below all details.

My configuration:

(deepspeech-venv) $ inxi -S
System:    Host: giorgio-HP-Laptop-17-by1xxx Kernel: 5.8.0-50-generic x86_64 bits: 64 Desktop: Gnome 3.36.7 
           Distro: Ubuntu 20.04.2 LTS (Focal Fossa) 

(deepspeech-venv) $ deepspeech --version
DeepSpeech  0.9.3

deepspeech-venv) $ npm info deepspeech

deepspeech@0.9.3 | MPL-2.0 | deps: 5 | versions: 97
DeepSpeech NodeJS bindings
https://github.com/mozilla/DeepSpeech/tree/v0.9.3#project-deepspeech

bin: deepspeech

dist
.tarball: https://registry.npmjs.org/deepspeech/-/deepspeech-0.9.3.tgz
.shasum: 675917addc2e2a16fb2bc03718d6a4e6b1bbf650
.integrity: sha512-80yqUWEWgzclY9pjukpq0TdkQEbJ6NzqZ899vsLZfa4YcK35uOWIf+ILK55zQ+Ii/TEJ6Eo62Vc2saedQ/AK6w==
.unpackedSize: 120.3 MB

dependencies:
argparse: 1.0.x      memory-stream: 1.0.x node-pre-gyp: 0.15.x node-wav: 0.0.2      sox-stream: 2.0.x    

maintainers:
- deepspeech-ci <npmjs@deep-speech.org>
- reubenmorais <reuben.morais@gmail.com>
- mozilla-voice-owner <mozilla-voice-package-owner@mozilla.com>

dist-tags:
latest: 0.9.3               prerelease: 0.10.0-alpha.3  

(deepspeech-venv) $ node --version
v16.0.0

CRASH HAPPENS WHEN USING NODEJS V.16

(deepspeech-venv) $ node deepSpeechTranscriptNative.js 
node:internal/modules/cjs/loader:943
  throw err;
  ^

Error: Cannot find module '/home/giorgio/DeepSpeechJs/node_modules/deepspeech/lib/binding/v0.9.3/linux-x64/node-v93/deepspeech.node'
Require stack:
- /home/giorgio/DeepSpeechJs/node_modules/deepspeech/index.js
- /home/giorgio/DeepSpeechJs/deepSpeechTranscriptNative.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at Function.Module._load (node:internal/modules/cjs/loader:773:27)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/home/giorgio/DeepSpeechJs/node_modules/deepspeech/index.js:24:17)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Function.Module._load (node:internal/modules/cjs/loader:828:14)
    at Module.require (node:internal/modules/cjs/loader:1012:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/giorgio/DeepSpeechJs/node_modules/deepspeech/index.js',
    '/home/giorgio/DeepSpeechJs/deepSpeechTranscriptNative.js'
  ]
}

NO PROBLEMS WHEN USING NODEJS V.14.16.1

(deepspeech-venv) $ sudo n install 14.16.1
  installing : node-v14.16.1
       mkdir : /usr/local/n/versions/node/14.16.1
       fetch : https://nodejs.org/dist/v14.16.1/node-v14.16.1-linux-x64.tar.xz
   installed : v14.16.1 (with npm 6.14.12)
(deepspeech-venv) $ node --version
v14.16.1

(deepspeech-venv) $ node deepSpeechTranscriptNative.js 

usage: node deepSpeechTranscriptNative [<model pbmm file>] [<model scorer file>] [<audio file>]
using: node deepSpeechTranscriptNative ./models/deepspeech-0.9.3-models.pbmm ./models/deepspeech-0.9.3-models.scorer ./audio/4507-16021-0012.wav

TensorFlow: v2.3.0-6-g23ad988
DeepSpeech: v0.9.3-0-gf2e9c85
2021-05-03 11:32:41.310018: 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 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

pbmm                 : ./models/deepspeech-0.9.3-models.pbmm
scorer               : ./models/deepspeech-0.9.3-models.scorer
elapsed              : 10ms

audio file           : ./audio/4507-16021-0012.wav
transcript           : why should one halt on the way
elapsed              : 3131ms

free model elapsed   : 24ms

Notes:

  • it seems to me that the issue is related to NodeJs version 16.0 and previouses?).

  • I see that some updates has been done recently in the DeepSpeech project: https://github.com/mozilla/DeepSpeech/tree/master/native_client/javascript

  • I have the same issue if I install deepspech package 0.10.0-alpha.3 instead of 0.9.3

  • Maybe is the problem related to the deepspeech npm package (last update is 5 months ago) that has to be republished to include updates?

Thanks
Giorgio

@lissyx lissyx closed this as completed May 3, 2021
@lissyx
Copy link
Collaborator

lissyx commented May 3, 2021

@solyarisoftware There is no support for NodeJS v16 on the uploaded packages. Current packages on master have it but:

  • GitHub Actions support only covers linux (amd64, armv7, aarch64), windows (amd64), macOS (amd64)
  • Unfortunaly, unlike TaskCluster, we don't have the ability to access unauthenticated to the build artifacts
  • There is no support for publishing new releases (Handle tag event on GitHub Actions #3606)
  • TaskCluster infra has been completely decomissionned, so producing a 0.9.4 is impossible.

If you are willing to try and help, you are more than welcome. A good first item would be #3606 in your case.

Try and see if you can get deepspeech-tf.tgz or deepspeech-tflite.tgz from the last run: https://github.com/mozilla/DeepSpeech/actions/runs/793741932

@lissyx
Copy link
Collaborator

lissyx commented May 3, 2021

@solyarisoftware The move to GitHub Actions was to make it easier for contributor to actually contribute, please read https://mozilla.github.io/deepspeech-playbook/CONTINUOUS_INTEGRATION.html

@solyarisoftware
Copy link
Author

Hi @lissyx
I see your points / thanks for details.
I left the issue open. At least I propose to update this doc https://github.com/mozilla/DeepSpeech/blob/master/native_client/javascript/README.md with a reference to the current issue. Or I'd update the current public npm package version 0.9.3

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

No branches or pull requests

2 participants