Converting a SavedModel into model.json format

Since it is not possible to use a SavedModel directly from TensorFlow.js, we need to convert it into a compatible version and then load it in the TensorFlow.js runtime. The tensorflowjs_converter command-line application makes the conversion process straightforward. This tool not only performs the conversion between the SavedModel and the TensorFlow.js representation but also automatically quantizes the model, thereby reducing its dimensions when necessary.

Let's say we are interested in converting the SavedModel of the computational graph we exported in the previous section into TensorFlow format via the serialized pow function. Using tensorflowjs_converter, we only need to specify the input ...

Get Hands-On Neural Networks with TensorFlow 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.