RuntimeError: Load model failed - Score machine learning models with PREDICT in serverless Apache Spark pools (Synapse & Azure Machine learning AML)

Anaid 61 Reputation points
2021-12-08T16:39:03.063+00:00

Hi all,

I am following the steps on this tutorial:
Tutorial: Score machine learning models with PREDICT in serverless Apache Spark pools tutorial-score-model-predict-spark-pool
I tried to used a model created with AutoML and another from designer and I am getting this error: RuntimeError: Load model failed

155981-capture.png

I am using the model according to this: https://learn.microsoft.com/en-us/answers/questions/631200/what-is-aml-model-uri-predict-in-serverless-apache.html?childToView=637754#comment-637754

156021-2.png

Thank you for your help.

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,574 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,396 questions
{count} votes

Accepted answer
  1. PRADEEPCHEEKATLA-MSFT 77,751 Reputation points Microsoft Employee
    2021-12-14T05:36:00.303+00:00

    Hello @Anaid ,

    Before running this script, update it with the URI for ADLS Gen2 data file along with model output return data type and ADLS/AML URI for the model file.

    #Set model URI  
           #Set AML URI, if trained model is registered in AML  
              AML_MODEL_URI = "<aml model uri>" #In URI ":x" signifies model version in AML. You can   choose which model version you want to run. If ":x" is not provided then by default   latest version will be picked.  
      
           #Set ADLS URI, if trained model is uploaded in ADLS  
              ADLS_MODEL_URI = "abfss://<filesystemname>@<account name>.dfs.core.windows.net/<model   mlflow folder path>"  
    

    Model URI from AML Workspace:

    DATA_FILE = "abfss://data@cheprasynapse.dfs.core.windows.net/AML/LengthOfStay_cooked_small.csv"  
    AML_MODEL_URI_SKLEARN = "aml://mlflow_sklearn:1" #Here ":1" signifies model version in AML. We can choose which version we want to run. If ":1" is not provided then by default latest version will be picked  
    RETURN_TYPES = "INT"  
    RUNTIME = "mlflow"  
    

    Model URI uploaded to ADLS Gen2:

    DATA_FILE = "abfss://data@cheprasynapse.dfs.core.windows.net/AML/LengthOfStay_cooked_small.csv"  
    AML_MODEL_URI_SKLEARN = "abfss://data@cheprasynapse.dfs.core.windows.net/linear_regression/linear_regression" #Here ":1" signifies model version in AML. We can choose which version we want to run. If ":1" is not provided then by default latest version will be picked  
    RETURN_TYPES = "INT"  
    RUNTIME = "mlflow"  
    

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

0 additional answers

Sort by: Most helpful