Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Tensorflow in reactjs? (not react-native)

I want to use deep learning or machine learning to do some calculations on my front-end.

But there are no react examples.

My original idea was use python with react. Tensorflow would run in back-end in Python, while the front-end would be using React and get the results from the Python back-end.

Then I saw that Tensorflow is also in Javascript. So it can be used directly on the website, right?

Can React then directly use Tensorflow?

like image 485
JerryLi Avatar asked Jan 25 '26 14:01

JerryLi


1 Answers

Yes you can install it NPM, it is at their documentation: https://js.tensorflow.org/setup/

yarn add @tensorflow/tfjs or npm install @tensorflow/tfjs

Then import * as tf from '@tensorflow/tfjs';

Hope that helps

like image 157
rfdc Avatar answered Jan 27 '26 04:01

rfdc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!