Questions tagged [tensorflow.js]

TensorFlow.js is a library for developing and training ML models in JavaScript, and deploying in browser or on Node.js

Definition:

TensorFlow.js is a WebGL accelerated, browser based JavaScript library for training and deploying ML models.

Important Links:

Related Tags:

1582 questions
42
votes
1 answer

Machine Learning : Tensorflow v/s Tensorflow.js v/s Brain.js

I've recently started coding with Machine learning techniques and had been going back and forth between Machine learning implemented in different platforms. The frameworks i worked a lot with were Tensorflow (Python), Tensorflow.js and Brain.js. And…
user10140016
36
votes
12 answers

`ReferenceError: TextEncoder is not defined` when running `react-scripts test --env=jsdom`

I'm using a TensorFlow encoder in my application. It works fine in my browser when the application is running but I get issues when testing that it builds: $ npx react-scripts test --env=jsdom FAIL src/App.test.js ● Test suite failed to run …
Justin Harris
  • 1,969
  • 2
  • 23
  • 33
34
votes
4 answers

How to train a model in nodejs (tensorflow.js)?

I want to make a image classifier, but I don't know python. Tensorflow.js works with javascript, which I am familiar with. Can models be trained with it and what would be the steps to do so? Frankly I have no clue where to start. The only thing I…
Alex
  • 66,732
  • 177
  • 439
  • 641
18
votes
5 answers

Get the value of an item in a tensor in Tensorflow.js

How do I get the value out of a tensor in Tensorflow.js after specifying the index?
Pranay Aryal
  • 5,208
  • 4
  • 30
  • 41
16
votes
11 answers

Load Tensorflow js model from local file system in javascript

I have converted a keras model to tensorflow json format and saved it locally in my computer. I am trying to load that json model in a javascript code using the below command model = await tf.loadModel('web_model') But the model is not getting…
user2693313
  • 341
  • 3
  • 5
  • 13
16
votes
2 answers

How to convert 1D tensor to regular javascript array?

How to convert 1D tensor to regular Javascript array in Tensorflow.js? My 1D Tensor is like this: Tensor [-0.0005436, -0.0021222, 0.0006213, 0.0014624, 0.0012601, 0.0007024, -0.0001113, -0.0011119, -0.0021328, -0.0031764]
user1636258
  • 163
  • 1
  • 7
14
votes
2 answers

Memory leak in Tensorflow.js: How to clean up unused tensors?

I'm writing a script, which sometimes leaks tensors. This can happen in multiple cases, for example when I'm training a neural network, but the training crashes. In this case, the training is interrupted and will not correctly dispose the tensors.…
12
votes
2 answers

OpenAI GPT-2 model use with TensorFlow JS

Is that possible to generate texts from OpenAI GPT-2 using TensorFlowJS? If not what is the limitation, like model format or ...?
jay
  • 477
  • 5
  • 13
12
votes
2 answers

Using Custom vision exported model with tensorflow JS and input an image

I'm new to tensorflow.js and tensorflow The context : We have trained a model using custom vision to recognized from an image, the hairlength : short, mid, long. This model was exported and we would like to use it in local with tensorflow js. The…
12
votes
1 answer

Converting png to Tensor tensorflow.js

I'm currently attempting to figure out how to convert a input png into a tensor with tensorflow.js so I can feed it into my model for training. Currently I'm capturing the image, saving it locally, reading it with fs.readFileSync, and then creating…
Royce Birnbaum
  • 185
  • 1
  • 2
  • 12
12
votes
5 answers

Tensorflow.js save model using node

I want to save a trained model from node.js using this function async function tfModelExperiment(model) { try { let tsModelTraining = await model.save('file:///tmp/my-model-1'); } catch (error) { console.log(error); } } but when…
Schotsl
  • 187
  • 1
  • 8
  • 29
11
votes
2 answers

What is the batchSize in TensorFlow's model.fit() function?

After having defined a model with TensorFlow.js, you can run model.fit() to train it. This function takes a number of parameters, including a configuration object. This object has a property batchSize. The documentation on model.fit() just…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
11
votes
4 answers

tensorflowjs_converter: command not found

I'd like to convert keras model to tensorflow.js model. I run the offical command : tensorflowjs_converter --input_format keras \ path/to/my_model.h5 \ path/to/tfjs_target_dir -bash:…
lyzMaster
  • 530
  • 1
  • 6
  • 17
1
2 3
99 100