Error in converting Azure AutoML model to ONNX format

Elahe Dorani 21 Reputation points
2023-10-08T20:49:35.7133333+00:00

I am working with Azure AutoML and have created a trial using different models. In the pipeline, the final step is a PipelineWithYTransformations.

Now, I am attempting to convert the generated .pkl model to an ONNX model, but I encounter the following error:

raise RuntimeError("Unable to find a shape calculator for type "
RuntimeError: Unable to find a shape calculator for type '<class 'azureml.training.tabular.models.pipeline_with_ytransformations.PipelineWithYTransformations'>'.

I am unsure how to handle this error and successfully convert the model to ONNX format.

Here are some additional details about my setup:

  • The AutoML trial was created with the goal of training a machine learning model.
  • I have tried using the convert function from the skl2onnx library to perform the conversion.
  • The error seems to be related to the specific type of model (PipelineWithYTransformations) generated by AutoML. I would appreciate any guidance or suggestions on how to resolve this issue and successfully convert the model to ONNX format. Thank you!

Question link in StackOverflow: https://stackoverflow.com/questions/77255239/error-in-converting-azure-automl-model-to-onnx-format

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,607 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,621 Reputation points
    2023-10-10T10:21:22.1833333+00:00

    @Elahe Dorani Thanks for the question, The error message suggests that the conversion process is unable to find a shape calculator for the type ‘PipelineWithYTransformations’. This type of model is generated by Azure AutoML.

    You might be using the convert function from the skl2onnx library to perform the conversion. However, it appears that this library might not support the ‘PipelineWithYTransformations’ model type

    Here is the sample for automl and generating the onnx model.

    User's image

    https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/automated-machine-learning/classification-bank-marketing-all-features/auto-ml-classification-bank-marketing-all-features.ipynb

    0 comments No comments