• Last Updated : 05 Oct, 2023

What is TensorFlow.js ?

TensorFlow.js is a JavaScript library for training and deploying machine learning models on web applications and in Node.js. You can develop the machine learning models from scratch using tensorflow.js or can use the APIs provided to train your existing models in the browser or on your Node.js server.

TensorFlow.js Tutorial

TensorFlow.js Tutorial

Why TenserFlow.js?

TensorFlow has a lot of machine learning libraries and is well-documented. It provides a few key functions and ways for doing so. TensorFlow is sometimes referred to as a “Google” product. A wide range of machine learning and deep learning algorithms are included. For handwritten digit classification, image recognition, word embedding, and the generation of other sequence models, TensorFlow can train and run deep neural networks.

Installation of TenserFlow.js

There are two methods by which we can install and use TenserFlow.js.

Method 1: Using CDN Link

We can use CDN link to run Tensorflow.js code without installing it.  Add the following CDN link into the script tag to the head section of the HTML file.

<script src=”https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.0.0/dist/tf.min.js”></script>

Method 2: Installation of TensorFlow.js using npm Package Manager

We can install it using npm. Before installing TensorFlow.js through npm, first, make sure you have installed Node.js and npm.

npm install @tensorflow/tfjs

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above