Questions tagged [tensorflowjs-converter]

The tensorflowjs-converter converts saved tensorflow models to tensorflow.js. Use this tag for questions related to the converter.

To convert a (suitable) model to tensorflow.js, you can use the tensorflowjs-converter command.

138 questions
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…
10
votes
4 answers

Retrain image detection with MobileNet

Several ways of retraining MobileNet for use with Tensorflow.js have failed for me. Is there any way to use a retrained model with Tensorflow.js? Both using the modern, hub-based tutorial, as well as using retrain.py seem to fail. Convert output of…
serv-inc
  • 35,772
  • 9
  • 166
  • 188
10
votes
2 answers

Difference between tfjs_layers_model and tfjs_graph_model

The tensorflowjs converter has the output formats tfjs_layers_model, tfjs_graph_model What is the difference between the two? Is there a use recommendation?
serv-inc
  • 35,772
  • 9
  • 166
  • 188
6
votes
0 answers

How to optimize re-trained ssd_mobilenet_v2_coco for tensorflowjs inference?

I am trying to re-train a mobilenet_v2 model for custom object detection by loosely following this tutorial. My end goal is to have a web_model I can query that will provide the scores, classIds, and number of detections. The final exported…
6
votes
2 answers

Different results for tensorflowjs and keras on same model and tensor

I trained a CNN model on some images following the example of https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html. My model code is identical, I just trained it on another image dataset: also for…
Ixio
  • 517
  • 6
  • 21
5
votes
1 answer

Uncaught (in promise) Error: Provided weight data has no target variable: block1_conv1_2/kernel

I am new to machine learning and I was following this blog on how to write a model with mobilenet. I managed to convert the .h5 file model and tried to implement it on my web app. Unfortunately, when I try to load the JSON model I get this…
Rstynbl
  • 545
  • 2
  • 6
  • 10
4
votes
2 answers

TensorflowJS: It is possible to convert a graph model to a layers model?

Is it possible to convert a graph model into a layers model? The official TensorFlow js converter (https://github.com/tensorflow/tfjs/tree/master/tfjs-converter) does not support this feature at the moment or are there reasons that cannot work?
4
votes
2 answers

Convert output of retrain.py to tensorflow.js

The script retrain.py described in How to Retrain an Image Classifier for New Categories was run as python retrain.py --tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/feature_vector/2 --image_dir /tmp/test and produced the…
4
votes
0 answers

tensorflowjs_converter Failed to import metagraph

I trained a model using the image_retraining guide of tensorflow (https://www.tensorflow.org/hub/tutorials/image_retraining). Then I tried to convert the pb model with tensorflojs_converter but I get an error about metagraph. My environment is…
4
votes
0 answers

Not able to load tensorflow JS model

I have already converted keras model to tensorflowjs model. But when I am trying to load the same in browser it gives error which says that Uncaught (in promise) Error: Provided weight data has no target variable: block1_conv1_1/kernel. I have…
Hardik Modi
  • 312
  • 4
  • 16
3
votes
1 answer

My converted tensorflow Transfer Learning model always returns same results in Tensorflow JS

I have created a model which applied Mobilenet V2 for the convolutional base layers in Google colab. Then I converted it by using this command: path_to_h5 = working_dir + '/Tensorflow_PY_Model/SavedModel.h5' path_tfjs = working_dir +…
3
votes
1 answer

What is the reason for major difference between predictions for Tensorflow in Python and for Tensorflow JS in browser?

I have created a model for object detection in Python Tensorflow and then converted it in Tensorflow JS so as to use in browser. The model works perfectly in python. Now, when I give an input image to browser, there is major difference between…
S M
  • 111
  • 11
3
votes
0 answers

TensorflowJS backend CPU kernel undefined is already registered

I am loading the TensorFlowJS library and backend GPU with these script tags: