skip to Main Content

I’ve used Azure AutoML to build and train a classification model. However, instead of deploying the model to a web service or real-time endpoint, I’d like to be able to download the model and run it on my local machine.

I’ve attempted to follow https://learn.microsoft.com/en-us/azure/machine-learning/v1/how-to-deploy-local, however it’s quite vague and I’m a beginner to using ML models so got stuck quite quickly.

2

Answers


  1. In Azure ML SDK v1 you can download the model and deploy locally. Here is the document and the sample notebook to deploy locally .

    You can download the model:

    From the portal, by selecting the Models tab, selecting the desired model, and on the Details page, selecting Download.
    From the command line, by using az ml model download.
    By using the Python SDK Model.download() method.

    Login or Signup to reply.
  2. Let’s assume you have downloaded your model using the Azure Portal GUI. Next to your model .pkl and executable script .py you should also find it’s dependencies .yml. That’s what you need to setup a local environment that matches the requirements of your model. Therefore:

    1. You most likely want to download and setup miniconda.
    2. Using the Anaconda Prompt you can then create an environment: conda env create -f conda_env_v_1_0_0.yml
    3. Finally, you can execute your model inside your conda environment:
    conda activate [envName]
    python [path to your script.py]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search