@tensorflow/tfjs-node is not correctly recognised when running examples
See original GitHub issueI am trying to run the NodeJS examples. The examples run, but seem to not properly utilize the TensorFlow C++ binding.
Steps to reproduce
cd face-api.js/examples/examples-nodejs
npm i
tsc faceDetection.ts
node faceDetection.js
Expected outcome:
Examples runs without warnings.
Actual outcome:
============================
Hi there 👋. Looks like you are running TensorFlow.js in Node.js. To speed things up dramatically, install our node backend, which binds to TensorFlow C++, by running npm i @tensorflow/tfjs-node, or npm i @tensorflow/tfjs-node-gpu if you have CUDA. Then call require('@tensorflow/tfjs-node'); (-gpu suffix for CUDA) at the start of your program. Visit https://github.com/tensorflow/tfjs-node for more details.
============================
Environment
Node: v11.14.0
face-api.js: 0.19.0
@tensorflow/tfjs-node: 1.0.2
Additional Informations
I tried running the examples with older versions to exclude the possibility of a problem with my setup. I managed to run the examples for face-api.js versions 0.17.0
and 0.17.1
with face-api.js picking up the TensorFlow bindings correctly.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top Results From Across the Web
@tensorflow/tfjs-node - npm
Start using @tensorflow/tfjs-node in your project by running `npm i ... Machines with Python 3.x will not install the bindings properly.
Read more >node.js - Tensorflow tfjs not working on my OS setup anymore
When I try running this simple tfjs-node image recognition example (https://github.com/tejas77/node-image-classification), it does not work.
Read more >TensorFlow.js in Node
TensorFlow on the CPU uses hardware acceleration to accelerate the linear algebra computation under the hood. This package will work on Linux, ...
Read more >Tensorflow.js Crash-Course - Gilbert Tanner
Use TensorFlow.js to define, train, and run models entirely in the browser using ... yarn add @tensorflow/tfjs-node or npm install @tensorflow/tfjs-node.
Read more >Simple Image Recognition Backend with Express + TF - Medium
The Step-by-Step Guide to Apply TensorFlow model built in Python to Node. ... You can check whether those are ready or not by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, I think I got it now. However, this is valuable information and might be important for newcomers that try to get started with face-api.js in a Node.js environment.
Suggestion
Should we …
tfjs-node
version in the Node.js example, such that the example will run correctly on a freshly cloned repo andtfjs-node
version is needed?If no objections, I am happy to send PR for the above mentioned.
Sorry for the confusion.
I Time Machine restored my repo to the state I had when I opened this issue. Now, I get
Aha, so I actually used
@tensorflow/tfjs-node@1.1.0
, not@tensorflow/tfjs-node@1.0.2
as said in OP. Apologies! So, it looks like the problem arises when using@tensorflow/tfjs-node>=1.1.0
.Indeed after
and
It now runs correctly 🎉