3

I trained a custom model using this tutorial: https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10

As output, I get checkpoint files, like model.ckpt-41288.data-00000-of-00001 or .data or .meta .

I can export it as a frozen graph, but Tensorflow.js does not support conversion of a frozen graph anymore. I tried using the legacy version but was unable to convert.

I have looked at Tensorflow's documentation and I found it to be confusing.

Can someone give me a simple solution for how to convert a trained Tensorflow model to tensorflow.js?

1 Answer 1

4

Do you get a directory with the name saved_model which contains after running export_inference_graph.py (as mentioned here)? Inside the directory it's the model in SavedModel format.

Using the latest tensorflowjs version (v2.0 and above) you should be able to convert the model from SavedModel format to tfjs format. The output files should be group1-shardxofx.bin files and a model.json file.

tensorflowjs_converter --input_format=tf_saved_model --output_node_names='detection_boxes,detection_classes,detection_features,detection_multiclass_scores,detection_scores,num_detections,raw_detection_boxes,raw_detection_scores' --saved_model_tags=serve --output_format=tfjs_graph_model path_to_your_exported_inference_model_dir/saved_model path_to_save_your_tfjs_model

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.