January 2018
Intermediate to advanced
310 pages
7h 48m
English
The model after training has to be exported and saved. The weights, biases, and the graph are stored for inference. We will train an MNIST model and store it. Start with defining the constants that are required, using the following code:
work_dir = '/tmp'model_version = 9training_iteration = 1000input_size = 784no_classes = 10batch_size = 100total_batches = 200
The model_version can be an integer to specify which model we want to export for serving. The feature config is stored as a dictionary with placeholder names and their corresponding datatype. The prediction classes and their labels should be mapped. The identity placeholder can be used with the API:
tf_example = tf.parse_example(tf.placeholder(tf.string, name='tf_example' ...
Read now
Unlock full access