Deploying with `tfjs-node` and missing `libtensorflow.so` file

853 views
Skip to first unread message

Lizz Thabet

unread,
Jul 15, 2018, 5:17:50 PM7/15/18
to TensorFlow.js Discussion
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.<anonymous> (/app/node_modules/@tensorflow/tfjs-node/dist/index.js:7:9)
{ version: '0.1.8' }


Has anyone had success deploying a model running on tfjs-node, or can give us guidance on what setup might be missing?

Nick Kreeger

unread,
Jul 15, 2018, 5:53:06 PM7/15/18
to Lizz Thabet, TensorFlow.js Discussion
Hi Liza,

Can you try with 0.1.9? We just fixed and issue downloading that lib over curl.

Thanks,
Nick

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/8334bd05-1efc-4381-8822-8aeaa50b0355%40tensorflow.org.

Lizz Thabet

unread,
Jul 15, 2018, 9:03:27 PM7/15/18
to TensorFlow.js Discussion, lizzt...@gmail.com
Thanks for the suggestion. I just updated the version, but am still seeing the same error on Heroku.

Nick Kreeger

unread,
Jul 16, 2018, 12:25:52 AM7/16/18
to Lizz Thabet, TensorFlow.js Discussion
Hi Lizz,

Thanks for testing that - I filed https://github.com/tensorflow/tfjs/issues/517 and I'll take a look this week.

Thanks,
Nick

Reply all
Reply to author
Forward
0 new messages