question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19

github_iconTop GitHub Comments

2reactions
franckOLcommented, Aug 12, 2021

@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

1reaction
playgroundcommented, Jun 29, 2021

@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'
}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation error for tfjs-node on raspberry pi 3
When I install tfjs-node, and run it: Welcome to Node.js v14.16.0. Type ".help" for more ... wrong ELF class: ELFCLASS64 at Object.Module.
Read more >
Node-expat wrong ELF class: ELFCLASS64 - Stack Overflow
I've tried rebuilding my node application on both 32 and 64 bit versions of linux though seems to through the issue when I...
Read more >
@tensorflow/tfjs-node - npm
This package will work on Linux, Windows, and Mac platforms where TensorFlow is supported. Installing. TensorFlow.js for Node currently supports ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found