Preparing a full original model for scoring
After training for a full model is complete, we will use a Scoring
Jupyter notebook in this repository to demonstrate scoring with a full model. This notebook can be found in https://github.com/PacktPublishing/learn-tensorflow-enterprise/blob/master/chapter_07/train_base_model/Scoring.ipynb.
For the original model, it is stored in the savedModel
Protobuf format. We need to load it as follows:
import tensorflow as tf import numpy as np import matplotlib.pyplot as plt from PIL import Image, ImageOps import IPython.display as display path_saved_model = 'trained_resnet_vector-unquantized/save_model' trained_model = tf.saved_model.load(path_saved_model)
The full model we just trained is now loaded in our Jupyter notebook's runtime as trained_model
. For scoring, a few more steps are required. We have to find the model signature for prediction:
signature_list = list(trained_model.signatures.keys()) signature_list
It...