tfjs: Issue Raspberry install tfjs-node 3.7.0 , wrong ELF class: ELFCLASS64

When I install tfjs-node, and run it

Welcome to Node.js v14.16.0.
Type ".help" for more information.
> const tf = require('@tensorflow/tfjs');
undefined
> require('@tensorflow/tfjs-node')
node-pre-gyp info This Node instance does not support builds for Node-API version 8
node-pre-gyp info This Node instance does not support builds for Node-API version 8
Uncaught:
Error: /home/pi/program/nanocptscenariorunner/node_modules/@tensorflow/tfjs-node/lib/napi-v7/tfjs_binding.node: wrong ELF class: ELFCLASS64
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
>

When doing

npm rebuild @tensorflow/tfjs-node 
....
gyp verb node dev dir /home/pi/.cache/node-gyp/14.16.0
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
../binding/tfjs_backend.cc: In function ‘TFE_TensorHandle* tfnodejs::CreateTFE_TensorHandleFromStringArray(napi_env, int64_t*, uint32_t, TF_DataType, napi_value)’:
../binding/tfjs_backend.cc:196:64: error: ‘TF_TString’ was not declared in this scope
                                          array_length * sizeof(TF_TString)));
                                                                ^~~~~~~~~~
../binding/tfjs_backend.cc:198:15: error: ‘t’ was not declared in this scope
....

Nodejs: 14.13 Raspbian lite strech Raspberry 3 armv7l ==> 32 bits

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (3 by maintainers)

Most upvoted comments

@franckOL could you please update if you are still facing same issue ?

I update my version nodejs form 14.17.1 to 14.17.3. And it is OK

@pyu10055 @franckOL I’m running into the same issue in Raspberry p3

I’m running tfjs-node v3.3.0 due to a regression bug with v3.7 as suggested by @pyu10055 https://github.com/tensorflow/tfjs/issues/5161#issuecomment-854972551, has this been resolved for v3.7?

What to do to get it to run in RPi

> node index.js

node:internal/modules/cjs/loader:1167
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: /server/node_modules/@tensorflow/tfjs-node/lib/napi-v7/tfjs_binding.node: wrong ELF class: ELFCLASS64
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1167:18)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/server/node_modules/@tensorflow/tfjs-node/dist/index.js:60:16)
    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:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14) {
  code: 'ERR_DLOPEN_FAILED'
}