3 - Compare, Register and Deploy the Model
Last updated
Last updated
In the previous part, we used PrimeHub Notebook to train and manage the base model. In this part, we will:
Compare the results of these two experiment.
The experiment with the best performance will be registered in PrimeHub Models
Deploy as an online API service via PrimeHub's Model Deployment feature.
Use the command line to test the API service.
Before we get started, enable the Model Deployment toggle in your group settings.
There are two methods to get your pre-package docker image:
You can use our model pre-package docker image:
Image Name: infuseaidev/tensorflow2-prepackaged:screw-classification
You can build your own pre-packaged docker image by followed the advanced guide.
To compare the results, click the checkbox next to each run to select them, then click the Compare button.
→ MLFlow server UI → Choose two runs → Click Compare.
Check the best score in Metrics
At the top of the page, click the Run ID link for the run.
In the Artifact, register the model folder as our model registry.
Enter the model information to register the model.
On the Models page in the PrimeHub user portal, click our managed model with the name tf-screw-model.
The following page shows all versions of the tf-screw-model model. Click the Deploy button for Version 1.
In the Deploy Model dialog, select Create new deployment from the Deployment dropdown and then click OK.
Fill in the Deployment information:
Variable | Value |
---|---|
Deployment Name | tf-screw-deployment |
Model image | infuseai/tensorflow2-prepackaged:screw-classification |
InstanceTypes | CPU 1 |
Click the Deploy button, and you will be redirected to the Deployments page.
To view the details of the deployment, click the tf-screw-deployment card.
If you want to build your custom deployment logic and environment, you can see the information in the advanced tutorial section.
Run the following command line:
You can get the output result:
In this tutorial, we compared and selected a suitable model using MLflow, deployed a model, and tested the model with sample data.
In the next article, we will add a web application interface to our model using Streamlit, another app available through PrimeHub Apps.