Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@tensorflow/tfjs-node
Advanced tools
TensorFlow.js for Node currently supports the following platforms:
Other Linux variants might also work but this project matches core TensorFlow installation requirements.
npm install @tensorflow/tfjs-node
(or)
yarn add @tensorflow/tfjs-node
npm install @tensorflow/tfjs-node-gpu
(or)
yarn add @tensorflow/tfjs-node-gpu
Windows build support for node-gyp
requires Python 2.7. Be sure to have this version before installing @tensorflow/tfjs-node
or @tensorflow/tfjs-node-gpu
. Machines with Python 3.x will not install the bindings properly.
For more troubleshooting on Windows, check out WINDOWS_TROUBLESHOOTING.md.
If you do not have Xcode setup on your machine, please run the following commands:
$ xcode-select --install
After that operation completes, re-run yarn add
or npm install
for the @tensorflow/tfjs-node
package.
You only need to include @tensorflow/tfjs-node
or @tensorflow/tfjs-node-gpu
in the package.json file, since those packages ship with @tensorflow/tfjs
already.
Before executing any TensorFlow.js code, import the node package:
// Load the binding
import * as tf from '@tensorflow/tfjs-node';
// Or if running with GPU:
import * as tf from '@tensorflow/tfjs-node-gpu';
Note: you do not need to add the @tensorflow/tfjs
package to your dependencies or import it directly.
# Download and install JS dependencies, including libtensorflow 1.8.
yarn
# Run TFJS tests against Node.js backend:
yarn test
# Switch to GPU for local development:
yarn enable-gpu
See the tfjs-examples repository for training the MNIST dataset using the Node.js bindings.
This requires installing bazel first.
bazel build --config=monolithic //tensorflow/tools/lib_package:libtensorflow
FAQs
This repository provides native TensorFlow execution in backend JavaScript applications under the Node.js runtime, accelerated by the TensorFlow C binary under the hood. It provides the same API as [TensorFlow.js](https://js.tensorflow.org/api/latest/).
The npm package @tensorflow/tfjs-node receives a total of 36,577 weekly downloads. As such, @tensorflow/tfjs-node popularity was classified as popular.
We found that @tensorflow/tfjs-node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.