Skip to content

Node.js binding does not load on Heroku #517

@nkreeger

Description

@nkreeger

From the mailing list:

"My team and I are working on deploying a web app that uses a TFJS model powered by Node, rather than WebGL. We've successfully run the app on our local machines, but have encountered an issue running tfjs-node through Heroku (Ubuntu 16.04) and Docker (with an Alpine image). The same error shows up in both setups.

When requiring tfjs-node, the backend registration fails looking for libtensorflow.so. I've double-checked that the file libtensorflow.so is present in the directory that tfjs-node/scripts/download-libtensorflow.sh is looking for it in. This is the setup that we've been running on our local machines without a problem.

Here's the error from Heroku bash:

~ $ node

const tf = require('@tensorflow/tfjs')
undefined
require('@tensorflow/tfjs-node')
Registration of backend tensorflow failed
Error: libtensorflow.so: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (module.js:681:18)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at bindings (/app/node_modules/bindings/bindings.js:81:44)
at /app/node_modules/@tensorflow/tfjs-node/dist/index.js:8:60
at Environment.registerBackend (/app/node_modules/@tensorflow/tfjs-core/dist/environment.js:296:27)
at Object. (/app/node_modules/@tensorflow/tfjs-node/dist/index.js:7:9)
{ version: '0.1.8' }
"

Even with the fix shipped in 0.1.9 this is still happening. Some investigation is needed to figure out why the Node process can't find the library on Heroku.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions