Questions tagged [tfjs-node]
64 questions
6
votes
6 answers
Handpose tfjs Error - No backend found in registry
When trying to run a demo project for Handpose tfjs, I get the below error.
My package.json file has below dependencies:
{
"name": "tensorflowJs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"watch": "cross-env…

Divya Kaushik
- 820
- 1
- 8
- 9
4
votes
1 answer
How do I save a model using @tensorflow/tfjs-node v2?
I am struggling to get the save handler to work for saving my model. I've looked through all of stack overflow and GitHub, but no dice.
Ahhh help!!!! lol
Thanks a bunch ahead of time!!! :)
Here is my model code:
const tf =…

Juliana Hill
- 400
- 2
- 15
4
votes
1 answer
Tensorflow JS tfjs | Unable to load model using tf.loadLayersModel
While executing the following code embedded in html using WAMP stack
const model = tf.loadLayersModel('js/model.json');
I encounter the following errors in chrome
> Uncaught (in promise) TypeError: Failed to fetch
> platform_browser.ts:28 GET…

Avi
- 41
- 1
- 5
4
votes
1 answer
TypeError: The "original" argument must be of type Function
I am getting this error when trying to require tfjs-node in my electron react application. This issue wasn't happening before when I did not have react installed and I think it is due to something in the webpack require configuration.
const tf =…

BradleyB19
- 147
- 5
- 10
4
votes
2 answers
Tensorflow Node-js, TypeError: Only HTTP(S) protocols are supported
I am trying to load a local tensorflowjs model on my Node server but am getting the error:
UnhandledPromiseRejectionWarning: TypeError: Only HTTP(S) protocols are supported.
This is how I am importing the Tensorflowjs packages:
const tf =…

BradleyB19
- 147
- 5
- 10
4
votes
1 answer
How to use the Model.save function on TFJS hub models?
I don't know javascript and so I wanted to move a HUB model that's only available in JS to a SavedModel format.
I copied this script from a tutorial and tried to add the model.save function, but it's not working.
Here's the script:
…

Kathy Jones
- 76
- 2
3
votes
1 answer
@tensorflow/tfjs-node: Error: Failed to load SavedModel: Op type not registered 'NonMaxSuppressionV5' in binary running
The issue
I developed a simple NodeJS app for object detection using @tensorflow/tfjs-node. Everything works fine on my development PC (Windows 10 Pro), but trying to execute on my Raspberry Pi 2B (Raspbian 10), I got the following error:
Overriding…

cespon
- 5,630
- 7
- 33
- 47
2
votes
1 answer
How to use mobilenet as feature-extractor for high resolution images?
How can i use a mobilenet model as a feature-extractor for images with way higher resolution than 224x224?
I guess i need to change a certain layer after it's loaded to increase the input size? My current code is this:
const featureExtractor = await…

Martin Cremer
- 5,191
- 2
- 32
- 38
2
votes
1 answer
Tensorflow js error on Mac OS 11 with m1 chip
Trying to run basic get started example with tfjs in max m1 chip and getting illegal argument : 4 error. Is there anything specific need to be done for Mac m1 chip . Any help

Meiyappan Kannappa
- 720
- 9
- 35
2
votes
0 answers
tfjs-node tf.constant not a function error
Simple code that works fine in python environment was rewritten to run in node js but I can't seem to get it to work.
The node js code looks like:
const tf = require('@tensorflow/tfjs-node');
var x= tf.constant([10, 20, 30])
var y= tf.constant([ 2,…

Rodney East
- 21
- 2
1
vote
1 answer
DDPG training in Tensorflow.js
I'm trying to figure out how to implement DDPG in Tensorflow.js using Python examples such as this one from keras website. I got stuck on the training code:
with tf.GradientTape() as tape:
target_actions =…

Oleg Khalidov
- 5,108
- 1
- 28
- 29
1
vote
0 answers
react-native tensorflow.js bundleResourceIO hangs metro bundler
I'm new to React Native and trying to load a model using @tensorflow/tfjs-react-native and I've narrowed down the problem to the bundleResourceIO function. Every time npx react-native run-android is run, the project initializes successfully, builds…

borschy
- 23
- 1
- 8
1
vote
0 answers
Memory leak in tfjs-node code even when using tidy() and dispose()
My tfjs-node application is crashing due to running out of memory despite using tidy() and dispose() to prevent memory leaks. I've managed to reproduce the issue in the code below:
import * as tf from '@tensorflow/tfjs-node'
let x =…

Michael Jennings
- 11
- 1
1
vote
0 answers
tensorFlowJs Json model issue
trying to get a custom tensorFlowJS model to work in JS but getting error with the shape, kindly note that the model is already trained and converted to model.json but getting below error
Error: Error: Error in concat4D: Shape of tensors[1]…

Dev
- 9
- 1
1
vote
1 answer
How to .apply() a layer to the outputs of a model (transfer learning)
I am trying to finetune a CNN in tensorflow.js. To do this, I would like to add a head to the final layer of the pretrained model. The equivalent code in python tensorflow is as follows, where we add an average pooling layer to the pretrained…

Stanley
- 801
- 2
- 10
- 20