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

tfjs-node fails to install correctly op Raspberry Pi #3052

Closed
beele opened this issue Apr 8, 2020 · 10 comments
Closed

tfjs-node fails to install correctly op Raspberry Pi #3052

beele opened this issue Apr 8, 2020 · 10 comments

Comments

@beele
Copy link

beele commented Apr 8, 2020

TensorFlow.js version

1.7.2 (and older ones too, however some very old versions do work on the rbi, like 1.2.11 do work)

Node version

12.14.1

Raspbian version

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

Tested on a Pi 4 with 4GB of RAM

Describe the problem or feature request

After installing the tfjs-node dependency, the required rebuild step fails with the message: Unsupported system: cpu-linux-arm

Code to reproduce the bug / link to feature request

> @tensorflow/[email protected] install /home/pi/test/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-linux-1.7.2.tar.gz
* Downloading libtensorflow
(node:15080) UnhandledPromiseRejectionWarning: Error: Unsupported system: cpu-linux-arm
    at getPlatformLibtensorflowUri (/home/pi/test/node_modules/@tensorflow/tfjs-node/scripts/install.js:95:11)
    at downloadLibtensorflow (/home/pi/test/node_modules/@tensorflow/tfjs-node/scripts/install.js:129:7)
    at async run (/home/pi/test/node_modules/@tensorflow/tfjs-node/scripts/install.js:190:5)
(node:15080) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15080) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@tensorflow/[email protected] /home/pi/test/node_modules/@tensorflow/tfjs-node

How can I install a recent version that does work on the rbpi?

@traumverloren
Copy link

Thanks @beele for reporting this issue. I'm also experiencing this exact issue. Thanks y'all for looking into it. :)

@traumverloren
Copy link

traumverloren commented Apr 14, 2020

FYI wanted to update that I found a similar issue also open and these instructions worked for me on a RPI 4 (in the meantime til this is resolved):

Similar issue: #2872

Steps to work around: https://github.com/yhwang/node-red-contrib-tf-model

@beele
Copy link
Author

beele commented May 8, 2020

@kangyizhang any progress on this?

@beele beele changed the title tfjs-node fails to install correctlt op Raspberry Pi tfjs-node fails to install correctly op Raspberry Pi Jun 6, 2020
@paolomemoli
Copy link

The workaround outlined by @traumverloren is not working for me.

pm ERR! command sh -c node scripts/install.js
npm ERR! CPU-linux-3.6.1.tar.gz
npm ERR! node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | linux | arm
npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download 
npm ERR! node-pre-gyp info check checked for "/home/pi/otto-os/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node" (not found)
npm ERR! node-pre-gyp http GET https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.6.1/CPU-linux-3.6.1.tar.gz
npm ERR! node-pre-gyp http 404 https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.6.1/CPU-linux-3.6.1.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.6.1/CPU-linux-3.6.1.tar.gz 
npm ERR! node-pre-gyp WARN Pre-built binaries not found for @tensorflow/[email protected] and [email protected] (node-v88 ABI, glibc) (falling back to source compile with node-gyp) 
npm ERR! node-pre-gyp http 404 status code downloading tarball https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.6.1/CPU-linux-3.6.1.tar.gz 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm
npm ERR! gyp info ok 
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"

Anyone got any ideas how/when this will work?

@Utopiah
Copy link

Utopiah commented Jun 4, 2021

Same problem, also tried npm rebuild @tensorflow/tfjs-node --build-addon-from-source or npm rebuild @tensorflow/tfjs-node --build-from-source without success.

@vipinAG
Copy link

vipinAG commented Jun 18, 2021

Hi is there any update on this issue? I am facing the same issue, tried the solution by @traumverloren but doesnt seem to work, getting the below error

`https://s3.us.cloud-object-storage.appdomain.cloud/tfjs-cos/libtensorflow-gpu-linux-arm64-1.15.0.tar.gz
[==============================] 1044614/bps 100% 0.0s

  • Building TensorFlow Node.js bindings
    node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --build-from-source
    node-pre-gyp info it worked if it ends with ok
    node-pre-gyp info using [email protected]
    node-pre-gyp info using [email protected] | linux | arm64
    node-pre-gyp info build requesting source compile
    gyp info it worked if it ends with ok
    gyp info using [email protected]
    gyp info using [email protected] | linux | arm64
    gyp info ok
    node-pre-gyp ERR! UNCAUGHT EXCEPTION
    node-pre-gyp ERR! stack Error: When napi_versions is specified; module_path and either remote_path or package_name must contain the substitution string '{napi_build_version}.

@playground
Copy link

I'm also looking for a solution for the same issue Pi 4.

npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm ERR! code 1
npm ERR! path /home/pi/demo/node_modules/@tensorflow/tfjs-node
npm ERR! command failed
npm ERR! command sh -c node scripts/install.js
npm ERR! CPU-linux-3.0.0-rc.1.tar.gz
npm ERR! * Downloading libtensorflow
npm ERR! /home/pi/demo/node_modules/@tensorflow/tfjs-node/scripts/install.js:100
npm ERR!     throw new Error(`Unsupported system: ${libType}-${platform}-${os.arch()}`);
npm ERR!           ^
npm ERR! 
npm ERR! Error: Unsupported system: cpu-linux-arm64
npm ERR!     at getPlatformLibtensorflowUri (/home/pi/demo/node_modules/@tensorflow/tfjs-node/scripts/install.js:100:11)
npm ERR!     at downloadLibtensorflow (/home/pi/demo/node_modules/@tensorflow/tfjs-node/scripts/install.js:134:7)
npm ERR!     at async run (/home/pi/demo/node_modules/@tensorflow/tfjs-node/scripts/install.js:197:5)


@rthadur
Copy link
Contributor

rthadur commented Aug 12, 2021

Please check this issue #5173 , this has been resolved with latest versions.

@rthadur rthadur closed this as completed Aug 12, 2021
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@Utopiah
Copy link

Utopiah commented Aug 12, 2021

Thanks for the update @rthadur, a NodeJS version bump indeed solved install on my RPi3.

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

No branches or pull requests

9 participants