We have seen how to operationalize Keras models as web services in R and Python in a previous blog. Now we will see how to deploy a TensorFlow image classification model to Microsoft Machine Learning Server.
Click here to know more about Microsoft Machine Learning Server Operationalization. You can configure Machine Learning Server to operationalize analytics on a single machine (One-box) or multiple web and compute nodes that are configured on multiple machines along with other enterprise features.
Create a web service for a TensorFlow image classification model in Python
Before you can use the web service management functions in the azureml-model-management-sdk Python package, you must:
- Have access to a Python-enabled instance of Machine Learning Server that was properly configured to host web services.
- Authenticate with Machine Learning Server in Python as described in "Connecting to Machine Learning Server."
- Have Tensorflow installed on compute nodes.
- Have a trained TensorFlow image classification model.
In the following example, we are going to demonstrate how to operationalize a TensorFlow image classification model and generate web service API. We are using the trained ImageNet model downloaded from TensorFlow Models Repo.
- We first put the trained model on each compute node
- The below python script loads the model, builds the graph, and decodes image for classification
- The below python script deploys the image classification model as a service and generates service swagger