GraphDef, as you can see, only contains the minimum information to construct the model, which is not actually suitable for practical use cases. We may need a more comprehensive, platform-agnostic format to represent the machine learning model. SavedModel is the latest way to serialize a machine learning model in TensorFlow. Currently, using SavedModel is the recommended option to export a model trained by TensorFlow.js. This is because SavedModel contains not only the graph definition but also variables and graph metadata, so that higher-level systems or tools can consume the model and reuse it immediately.
Another major way to export the model is by using Keras. Keras is a high-level TensorFlow API that enables us to construct our model more intuitively. The usage of Keras is very similar to the TensorFlow.js Layers API. Many data scientists...