# TF.js

**URL:** https://discuss.ai.google.dev/c/tensorflow/special-interest-groups/tfjs/56.md

[Latest](https://discuss.ai.google.dev/latest.md) · [Categories](https://discuss.ai.google.dev/categories.md) · [Tags](https://discuss.ai.google.dev/tags.md)

---

## [About the SIG TF.js category](https://discuss.ai.google.dev/t/about-the-sig-tf-js-category/24714)

<div class="topic-metadata">

**Author:** [@kristen](https://discuss.ai.google.dev/u/kristen)\
**Replies:** 0

</div>

SIG TF.js facilitates community-contributed components to tensorflow/tfjs. The core TensorFlow.js engineering team has been working on building the infrastructure and tooling to enable ML to run in JavaScript-powered ap…

---

## [Can GraphModels be extended (add layers for example) or used in transfer learning?](https://discuss.ai.google.dev/t/can-graphmodels-be-extended-add-layers-for-example-or-used-in-transfer-learning/27497)

<div class="topic-metadata">

**Author:** [@Mah\_Neh](https://discuss.ai.google.dev/u/Mah_Neh)\
**Replies:** 1\
**Last updated:** [March 18, 2025, 8:36am UTC](https://discuss.ai.google.dev/t/can-graphmodels-be-extended-add-layers-for-example-or-used-in-transfer-learning/27497 "2025-03-18T08:36:57Z")

</div>

I am testing a few models, but the SavedModels that I find (In the hub for example) and are loaded with GraphModels API does not seem to allow any customization of the Neural Net… Is this correct ? Are SavedModels curre…

---

## [Dynamic optimizer](https://discuss.ai.google.dev/t/dynamic-optimizer/29733)

<div class="topic-metadata">

**Author:** [@gotostereo](https://discuss.ai.google.dev/u/gotostereo)\
**Replies:** 1\
**Last updated:** [December 5, 2024, 9:35am UTC](https://discuss.ai.google.dev/t/dynamic-optimizer/29733 "2024-12-05T09:35:06Z")

</div>

Hi! I use tf js, and i have a question example let optimizer = tf.train.adam(0.1, 0.99, 0.999) this.model = tf.sequential(); this.model.add( tf.layers.dense({ inputShape: \[units\], units: units, …

---

## [Conversion problems for Conv3D](https://discuss.ai.google.dev/t/conversion-problems-for-conv3d/30579)

<div class="topic-metadata">

**Author:** [@Marco\_Di\_Benedetto](https://discuss.ai.google.dev/u/Marco_Di_Benedetto)\
**Replies:** 1\
**Last updated:** [December 3, 2024, 9:31am UTC](https://discuss.ai.google.dev/t/conversion-problems-for-conv3d/30579 "2024-12-03T09:31:56Z")

</div>

Hi there, I am trying to convert a PyTorch model which uses a 3D convolution to be used with Tensorflow.js for inference. I saved my PyTorch model in ONNX (with torch.onnx.export) and then converted to a TF Saved Model…

---

## [Integrating @tensorflow/tfjs-react-native for body segmentation](https://discuss.ai.google.dev/t/integrating-tensorflow-tfjs-react-native-for-body-segmentation/31781)

<div class="topic-metadata">

**Author:** [@earth\_bula](https://discuss.ai.google.dev/u/earth_bula)\
**Replies:** 1\
**Last updated:** [December 1, 2024, 7:01pm UTC](https://discuss.ai.google.dev/t/integrating-tensorflow-tfjs-react-native-for-body-segmentation/31781 "2024-12-01T19:01:09Z")

</div>

All the libraries requies for the body segmentation are installed. Here is my package.json file: “@mediapipe/selfie\_segmentation”: “^0.1.1675465747”, “@react-native-async-storage/async-storage”: “^1.23.1”, “@tensorflo…

---

## [Implementing your own Loss in TF JS](https://discuss.ai.google.dev/t/implementing-your-own-loss-in-tf-js/29037)

<div class="topic-metadata">

**Author:** [@Mah\_Neh](https://discuss.ai.google.dev/u/Mah_Neh)\
**Replies:** 1\
**Last updated:** [November 27, 2024, 9:44am UTC](https://discuss.ai.google.dev/t/implementing-your-own-loss-in-tf-js/29037 "2024-11-27T09:44:15Z")

</div>

Hi, I am thinking of implementing YOLO in Node JS for learning purposes. I can see how the tfjs.layers will help, but I cant quite see how would you create a custom loss, or if it is possible. Would this be using an Op…

---

## [How to build a NPM/Yarn package for a collection of TFJS functions to run in WebApps (not node.js)](https://discuss.ai.google.dev/t/how-to-build-a-npm-yarn-package-for-a-collection-of-tfjs-functions-to-run-in-webapps-not-node-js/31702)

<div class="topic-metadata">

**Author:** [@ulf1](https://discuss.ai.google.dev/u/ulf1)\
**Replies:** 1\
**Last updated:** [November 27, 2024, 6:36am UTC](https://discuss.ai.google.dev/t/how-to-build-a-npm-yarn-package-for-a-collection-of-tfjs-functions-to-run-in-webapps-not-node-js/31702 "2024-11-27T06:36:45Z")

</div>

Hello, does anyone know how to put TFJS for WebApp (client side) into a NPM/Yarn package. The TFJS dependency seems yo assume that models would run on node.js (client side). I have not much clue about the JS stuff. Does …

---

## [Add border around detected object react native](https://discuss.ai.google.dev/t/add-border-around-detected-object-react-native/29950)

<div class="topic-metadata">

**Author:** [@ochieng\_seth](https://discuss.ai.google.dev/u/ochieng_seth)\
**Replies:** 1\
**Last updated:** [November 22, 2024, 10:27am UTC](https://discuss.ai.google.dev/t/add-border-around-detected-object-react-native/29950 "2024-11-22T10:27:17Z")

</div>

how can i add a border to the object that has been detected

---

## [Data:image/jpg;base64 to TF.js](https://discuss.ai.google.dev/t/data-image-jpg-base64-to-tf-js/30397)

<div class="topic-metadata">

**Author:** [@Benjamin\_Woite](https://discuss.ai.google.dev/u/Benjamin_Woite)\
**Replies:** 1\
**Last updated:** [September 16, 2024, 2:07pm UTC](https://discuss.ai.google.dev/t/data-image-jpg-base64-to-tf-js/30397 "2024-09-16T14:07:59Z")

</div>

Hello, I got stuck. I tried a thousand ways and can not solve my problem. But I make something wrong. I’m using an API with a screenshot function. The function has inside the following snippet: image = documen…

---

## [Can't read csv file with danfojs readCSV](https://discuss.ai.google.dev/t/cant-read-csv-file-with-danfojs-readcsv/30013)

<div class="topic-metadata">

**Author:** [@Alessandro\_Pereira\_R](https://discuss.ai.google.dev/u/Alessandro_Pereira_R)\
**Replies:** 1\
**Last updated:** [September 16, 2024, 9:43am UTC](https://discuss.ai.google.dev/t/cant-read-csv-file-with-danfojs-readcsv/30013 "2024-09-16T09:43:52Z")

</div>

Hi everybody! I’m using Tensorflow.js and trying to load a csv file with Danfojs readCSV method. My code is below: const dfd = require('danfojs-node') dfd.readCSV("train.csv").then(df =\> { console.log('hi') df…

---

## [Running tensorflow-core in node js](https://discuss.ai.google.dev/t/running-tensorflow-core-in-node-js/26504)

<div class="topic-metadata">

**Author:** [@Mah\_Neh](https://discuss.ai.google.dev/u/Mah_Neh)\
**Replies:** 1\
**Last updated:** [August 27, 2024, 4:03am UTC](https://discuss.ai.google.dev/t/running-tensorflow-core-in-node-js/26504 "2024-08-27T04:03:08Z")

</div>

To avoid the large size of tfjs (140MB), since we do not need the layers api, we want to install tfjs-core which is just 30MB and then get the cpu-backend. However, would this run at the same speed than tfjs-node ? If…

---

## [Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'backend')](https://discuss.ai.google.dev/t/uncaught-in-promise-typeerror-cannot-read-properties-of-undefined-reading-backend/28761)

<div class="topic-metadata">

**Author:** [@Mayukhdeep](https://discuss.ai.google.dev/u/Mayukhdeep)\
**Replies:** 3\
**Last updated:** [July 13, 2024, 1:07am UTC](https://discuss.ai.google.dev/t/uncaught-in-promise-typeerror-cannot-read-properties-of-undefined-reading-backend/28761 "2024-07-13T01:07:39Z")

</div>

Hi everyone, I am experiencing the following error in my code: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'backend'). This error is occurring when I am trying to access the ‘backend’ pr…

---

## [Markerless tracking and pose estimation on the web browser with single camera](https://discuss.ai.google.dev/t/markerless-tracking-and-pose-estimation-on-the-web-browser-with-single-camera/32002)

<div class="topic-metadata">

**Author:** [@afasew22](https://discuss.ai.google.dev/u/afasew22)\
**Replies:** 2\
**Last updated:** [June 18, 2024, 9:27am UTC](https://discuss.ai.google.dev/t/markerless-tracking-and-pose-estimation-on-the-web-browser-with-single-camera/32002 "2024-06-18T09:27:25Z")

</div>

Hello everyone, We’re in the process of developing a web application that displays an MJPEG stream. Our goal is to identify specific objects in the video in real-time and perform pose estimation. Ideally, we’d like it t…

---

## [Setup a Residual Neural Network block in tfjs](https://discuss.ai.google.dev/t/setup-a-residual-neural-network-block-in-tfjs/25175)

<div class="topic-metadata">

**Author:** [@NotBatman](https://discuss.ai.google.dev/u/NotBatman)\
**Replies:** 0\
**Last updated:** [June 9, 2024, 1:27am UTC](https://discuss.ai.google.dev/t/setup-a-residual-neural-network-block-in-tfjs/25175 "2024-06-09T01:27:35Z")

</div>

I would like to implement the behavior of a ResNet (Residual Neural Network). Would the following code do that? More specifically, does the concatenate layer I have in the following code function like the identity skip…

---

## [Tensorflowjs\_converter installation issues May 2024](https://discuss.ai.google.dev/t/tensorflowjs-converter-installation-issues-may-2024/28973)

<div class="topic-metadata">

**Author:** [@Mr\_Jeremy\_Ellis](https://discuss.ai.google.dev/u/Mr_Jeremy_Ellis)\
**Replies:** 1\
**Last updated:** [May 27, 2024, 3:34am UTC](https://discuss.ai.google.dev/t/tensorflowjs-converter-installation-issues-may-2024/28973 "2024-05-27T03:34:52Z")

</div>

I seem to be getting errors recently when installing tensorflowjs to use the tensorflowjs\_converter. Is anyone else having similar issues? I know things are not working, when I try: tensorflowjs\_converter --help and g…

---

## [TFJS selfie\_segmentation face swap demo](https://discuss.ai.google.dev/t/tfjs-selfie-segmentation-face-swap-demo/30887)

<div class="topic-metadata">

**Author:** [@Pjotter\_de\_Plotter](https://discuss.ai.google.dev/u/Pjotter_de_Plotter)\
**Replies:** 1\
**Last updated:** [March 26, 2024, 5:20am UTC](https://discuss.ai.google.dev/t/tfjs-selfie-segmentation-face-swap-demo/30887 "2024-03-26T05:20:54Z")

</div>

The demo selfie\_segmention shows some kind of inpainting of the mona lisa over your own face segmentation. I tried to play with this, but i cannot find any hints on how this is achieved. I tried browsing through the sour…

---

## [Minimum device hardware to run face detection using WebGL as a backend on tensorflowjs](https://discuss.ai.google.dev/t/minimum-device-hardware-to-run-face-detection-using-webgl-as-a-backend-on-tensorflowjs/32181)

<div class="topic-metadata">

**Author:** [@irufano](https://discuss.ai.google.dev/u/irufano)\
**Replies:** 2\
**Last updated:** [February 27, 2024, 1:56am UTC](https://discuss.ai.google.dev/t/minimum-device-hardware-to-run-face-detection-using-webgl-as-a-backend-on-tensorflowjs/32181 "2024-02-27T01:56:01Z")

</div>

I want to use tensorflowjs face detection pretrained model into browser using WebGL as a backend, is there any minimum device requirement like vga, ram etc, to run this on browser?

---

## [Data type in tensor: i32 vs f32](https://discuss.ai.google.dev/t/data-type-in-tensor-i32-vs-f32/32266)

<div class="topic-metadata">

**Author:** [@Franck\_Barbier](https://discuss.ai.google.dev/u/Franck_Barbier)\
**Replies:** 2\
**Last updated:** [February 15, 2024, 1:36pm UTC](https://discuss.ai.google.dev/t/data-type-in-tensor-i32-vs-f32/32266 "2024-02-15T13:36:57Z")

</div>

I use TensorFlow.js. Tensor data have the same type (dtype). In my case study, all data are integers with discrete distribution (typically, one of my input feature varies between 1 and 20). My feeling (not certain at al…

---

## [Using AsyncGenerator to create a dataset in TF.js](https://discuss.ai.google.dev/t/using-asyncgenerator-to-create-a-dataset-in-tf-js/29649)

<div class="topic-metadata">

**Author:** [@Mah\_Neh](https://discuss.ai.google.dev/u/Mah_Neh)\
**Replies:** 1\
**Last updated:** [December 1, 2023, 11:04pm UTC](https://discuss.ai.google.dev/t/using-asyncgenerator-to-create-a-dataset-in-tf-js/29649 "2023-12-01T23:04:03Z")

</div>

I do not see a way to do this: model.fitDataset(asyncGenerator) This would be useful when you have to load files asynchronously i.e: const iteratorParams = (n: number, labels: number\[\]\[\], paths: string\[\]) =\> async f…

---

## [WebGL 1 vs WebGL 2](https://discuss.ai.google.dev/t/webgl-1-vs-webgl-2/30796)

<div class="topic-metadata">

**Author:** [@Elias](https://discuss.ai.google.dev/u/Elias)\
**Replies:** 1\
**Last updated:** [November 14, 2023, 1:59pm UTC](https://discuss.ai.google.dev/t/webgl-1-vs-webgl-2/30796 "2023-11-14T13:59:21Z")

</div>

Why Tensorflow.js is still using WebGL 1 instead of WebGL 2? Is it because WebGL 2 vs 1 is not really a performance upgrade but more about features? Or is compatibility the main issue (although afaik WebGL 2 is backwar…

---

## [Custom Object Detection Model Is Very Slow With Tensorflow.js](https://discuss.ai.google.dev/t/custom-object-detection-model-is-very-slow-with-tensorflow-js/28859)

<div class="topic-metadata">

**Author:** [@Liju\_Alivenow](https://discuss.ai.google.dev/u/Liju_Alivenow)\
**Replies:** 1\
**Last updated:** [October 25, 2023, 7:30pm UTC](https://discuss.ai.google.dev/t/custom-object-detection-model-is-very-slow-with-tensorflow-js/28859 "2023-10-25T19:30:41Z")

</div>

I have created my own object detection model using Google Colab and flowed through the tutorial given below. Around 100 images were labeled with Labellmg for single-object detection. The chosen model is ss…

---

## [How to make tf.js CPU backend faster at computing gradient of small functions (\<100 params)? A benchmark comparision with numerical differentiation in pure JS](https://discuss.ai.google.dev/t/how-to-make-tf-js-cpu-backend-faster-at-computing-gradient-of-small-functions-100-params-a-benchmark-comparision-with-numerical-differentiation-in-pure-js/31719)

<div class="topic-metadata">

**Author:** [@VictorPoughon](https://discuss.ai.google.dev/u/VictorPoughon)\
**Replies:** 3\
**Last updated:** [October 18, 2023, 1:22pm UTC](https://discuss.ai.google.dev/t/how-to-make-tf-js-cpu-backend-faster-at-computing-gradient-of-small-functions-100-params-a-benchmark-comparision-with-numerical-differentiation-in-pure-js/31719 "2023-10-18T13:22:58Z")

</div>

Hi there, For fun, I’ve been trying to reimplement G9.js interactive graphics using TF.js automatic differentiation instead of finite difference (which G9 uses). I’ve managed to do it, but the use case is very differen…

---

## [TFJS - parallelise models inference](https://discuss.ai.google.dev/t/tfjs-parallelise-models-inference/30936)

<div class="topic-metadata">

**Author:** [@Daniil\_Emtsev](https://discuss.ai.google.dev/u/Daniil_Emtsev)\
**Replies:** 1\
**Last updated:** [August 24, 2023, 5:45pm UTC](https://discuss.ai.google.dev/t/tfjs-parallelise-models-inference/30936 "2023-08-24T17:45:54Z")

</div>

Hey! I am wondering how to do the inference of more than one ML model in parallel in tfjs? If I create asynchronous functions of models inference (predict\_1, predict\_2) then if I run (await predict\_1, await predict\_2) i…

---

## [\[Info Need\] Loading Custom tfjs model on client side without exposing model weights to users](https://discuss.ai.google.dev/t/info-need-loading-custom-tfjs-model-on-client-side-without-exposing-model-weights-to-users/30305)

<div class="topic-metadata">

**Author:** [@chetwin\_low](https://discuss.ai.google.dev/u/chetwin_low)\
**Replies:** 1\
**Last updated:** [August 10, 2023, 9:09pm UTC](https://discuss.ai.google.dev/t/info-need-loading-custom-tfjs-model-on-client-side-without-exposing-model-weights-to-users/30305 "2023-08-10T21:09:42Z")

</div>

I was looking for a way to protect my custom trained model from users as I want to allow the user to load my tfjs model on their end (to reduce latency) without exposing the model weights to them, I came accross this thr…

---

## [Playing a video inside each bounding box](https://discuss.ai.google.dev/t/playing-a-video-inside-each-bounding-box/29625)

<div class="topic-metadata">

**Author:** [@Mayukhdeep](https://discuss.ai.google.dev/u/Mayukhdeep)\
**Replies:** 2\
**Last updated:** [August 3, 2023, 7:37am UTC](https://discuss.ai.google.dev/t/playing-a-video-inside-each-bounding-box/29625 "2023-08-03T07:37:53Z")

</div>

Hello, My problem set is to add a mp4 video playing inside a bounding box whenever detections are happening, I have tried this with images which works but with video, it’s not working inside a bounding box. export func…

---

## [Blazepose segmentation mask not working when setting WEBGL\_USE\_SHAPES\_UNIFORMS](https://discuss.ai.google.dev/t/blazepose-segmentation-mask-not-working-when-setting-webgl-use-shapes-uniforms/30922)

<div class="topic-metadata">

**Author:** [@Ben\_Cole](https://discuss.ai.google.dev/u/Ben_Cole)\
**Replies:** 8\
**Last updated:** [August 3, 2023, 3:34am UTC](https://discuss.ai.google.dev/t/blazepose-segmentation-mask-not-working-when-setting-webgl-use-shapes-uniforms/30922 "2023-08-03T03:34:51Z")

</div>

Hi, I’ve been trying to speed up model initialization for pose-detection using BlazePose with the tfjs runtime and tfjs-backend-webgl. I have tried setting WEBGL\_USE\_SHAPES\_UNIFORMS to true, however, I’m finding that t…

---

## [Check model for control flow or dynamic output shapes](https://discuss.ai.google.dev/t/check-model-for-control-flow-or-dynamic-output-shapes/26224)

<div class="topic-metadata">

**Author:** [@Lucas\_Liendo](https://discuss.ai.google.dev/u/Lucas_Liendo)\
**Replies:** 1\
**Last updated:** [August 3, 2023, 3:23am UTC](https://discuss.ai.google.dev/t/check-model-for-control-flow-or-dynamic-output-shapes/26224 "2023-08-03T03:23:31Z")

</div>

Hi everyone! I’ve been having this warning in the browser console: “This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.” So I have switched f…

---

## [How to build fact tree from a model?](https://discuss.ai.google.dev/t/how-to-build-fact-tree-from-a-model/30771)

<div class="topic-metadata">

**Author:** [@Vetrivel](https://discuss.ai.google.dev/u/Vetrivel)\
**Replies:** 0\
**Last updated:** [July 28, 2023, 3:27am UTC](https://discuss.ai.google.dev/t/how-to-build-fact-tree-from-a-model/30771 "2023-07-28T03:27:52Z")

</div>

I have an idea and I’d like to experiment it with a model. Idea : teach a language or text based model with custom truths. Prompt - Give me list of words in the model Prompt - Give me list of action words in the model …

---

## [Installation error of @tensorflow/tfjs-react-native](https://discuss.ai.google.dev/t/installation-error-of-tensorflow-tfjs-react-native/21462)

<div class="topic-metadata">

**Author:** [@Lekhraj\_Saini](https://discuss.ai.google.dev/u/Lekhraj_Saini)\
**Replies:** 1\
**Last updated:** [July 3, 2023, 3:55am UTC](https://discuss.ai.google.dev/t/installation-error-of-tensorflow-tfjs-react-native/21462 "2023-07-03T03:55:20Z")

</div>

I followed steps given in official docs of @tensorflow/tfjs-react-native at npmjs.com for bare react native project(without using expo) link:@tensorflow/tfjs-react-native - npm installation of all the prerequistes and …

---

## [Classification of same documents but different company (logo)](https://discuss.ai.google.dev/t/classification-of-same-documents-but-different-company-logo/32684)

<div class="topic-metadata">

**Author:** [@Pelonarax](https://discuss.ai.google.dev/u/Pelonarax)\
**Replies:** 3\
**Last updated:** [June 30, 2023, 8:23am UTC](https://discuss.ai.google.dev/t/classification-of-same-documents-but-different-company-logo/32684 "2023-06-30T08:23:27Z")

</div>

Hello everyone, probably a very noob question, I’m just started in this new magic worl of AI and ML. I’ve run every tutorial project I could find, i develop my own Dog or Cat model by transfering from MobileNet. I’m no…

[Next page](https://discuss.ai.google.dev/c/tensorflow/special-interest-groups/tfjs/56.md?page=1)
