A WebGL accelerated JavaScript library for training and deploying ML models.
A WebGL accelerated JavaScript library for training and deploying ML models.
TensorFlow.js is an open-source hardware-accelerated JavaScript library for training and deploying machine learning models.
Develop ML in the Browser
Use flexible and intuitive APIs to build models from scratch using the low-level
JavaScript linear algebra library or the high-level layers API.
Develop ML in Node.js
Execute native TensorFlow with the same TensorFlow.js API under the Node.js
runtime.
Run Existing models
Use TensorFlow.js model converters to run pre-existing TensorFlow models right
in the browser.
Retrain Existing models
Retrain pre-existing ML models using sensor data connected to the browser or
other client-side data.
This repository contains the logic and scripts that combine several packages.
APIs:
Backends/Platforms:
If you care about bundle size, you can import those packages individually.
If you are looking for Node.js support, check out the TensorFlow.js Node directory.
Check out our examples repository and our tutorials.
Be sure to check out the gallery of all projects related to TensorFlow.js.
Be sure to also check out our models repository where we host pre-trained models on NPM.
There are two main ways to get TensorFlow.js in your JavaScript project: via script tags or by installing it from NPM and using a build tool like Parcel, WebPack, or Rollup.
Add the following code to an HTML file:
…Open up that HTML file in your browser, and the code should run!
Add TensorFlow.js to your project using yarn or npm. Note: Because
we use ES2017 syntax (such as import), this workflow assumes you are using a modern browser or a bundler/transpiler
to convert your code to something older browsers understand. See our
examples
to see how we use Parcel to build
our code. However, you are free to use any build tool that you prefer.
…See our tutorials, examples and documentation for more details.
We support porting pre-trained models from:
Please refer below :
TensorFlow.js is a part of the TensorFlow ecosystem. For more info:
tfjs tag on the TensorFlow Forum.Thanks, BrowserStack, for providing testing support.
The package tfjs-node is not working in version 26.8.1 of Node
Object Scope — Browser-Based Real-Time Object Detection with TensorFlow.js
Feature Request: Add padSequences utility function for sequence preprocessing
[tfjs-node] Native tensor handles leak after signed int32 tensor ID rollover
[webgpu] Video frames imported via importExternalTexture are misoriented on iOS 26 (landmarks rotated ~90°)
I'm getting these npm errors while trying to install @tensorflow/tfjs-node
Memory leaks
Converting *.h5 model with tfjs
modStrict still mentioned in docs
Dispatch size exceeds WebGPU limits in Y or Z dimension