Unfortunately, models such as SavedModel of HDF5 created by TensorFlow cannot be used in the world of TensorFlow.js directly. It is inevitable that you will have to convert the model into a format readable by the web platform.
Converting models using tfjs-converter
Converting a TensorFlow SavedModel
Once the SavedModel is created, you can convert the SavedModel into TensorFlow.js format as follows:
$ tensorflowjs_converter \
--output_node_names=output \
--input_format=tf_saved_model \
./my_saved_model ./my_tfjs_model
The input path and output path are required as positional arguments. (my_saved_model and my_tfjs_model). The model will be generated in the my_tfjs_model directory. The options specified in the preceding...