Load ML model (.pkl) and use in local

0

I have trained the ML model in Azure machine learning, and I hope not to deploy it to an endpoint. Instead, I hope to load the model and run it in my local machine to predict the result.

I got these files downloaded from Azure as shown below. So, what should I do to load the model and do the prediction? Do all these 3 files are required to use, or only the .pkl file is needed?

1

0

We can target local machines for deploying our models which are created in Azure Machine Learning.

In your case we need to use docker image as it provides isolated, containerized experience.

Below are the steps to deploy as local web service using Docker:

  1. Connect to the Azure Machine Learning workspace in which your model is registered.
  2. Create a Model object that represents the model.
  3. Create an Environment object that contains the dependencies and defines the software environment in which your code will run.
  4. Create an InferenceConfig object that associates the entry script with the Environment.
  5. Create a DeploymentConfiguration object of the subclass LocalWebserviceDeploymentConfiguration.
  6. Use Model.deploy() to create a Webservice object. This method downloads the Docker image and associates it with the Model, InferenceConfig, and DeploymentConfiguration.
  7. Activate the Webservice by using Webservice.wait_for_deployment().

Refer to this documentation as AjayKumarGhose suggested. Also check this MSDoc for training an image model

2021-12-03 10:25:42

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................