How to use a auto ml pickle file from azure studio in a c# .NET api?

AMROUN Lysa 181 Reputation points
2023-03-29T08:53:34.17+00:00

Hello to all,

I am currently working on a Machine Learning project, I have launched the auto ML of Microsoft Azure Studio on my data and I have downloaded the best model in a folder with the appropriate Pickle file. However I would like to use this pickle in my prediction API in c# .NET, for this fact I used Microsoft.ML, to load the pickle and use it, here is my code snippet :

"MLContext mLContext = new MLContext();

var model = mLContext.Model.Load(PicklePath, out DataViewSchema schema); "

However I have an error at this level (2nd line), the error tells me : "Repository doesn't contain entry DataLoaderModel\Model.key".

From what I understand the pickle is incompatible with Microsoft.ML, how can I use the resulting pickle of auto ml in this api please?

Thanks in advance,

Lysa

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,346 questions
Azure
Azure
A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.
927 questions
0 comments No comments
{count} votes

Accepted answer
  1. romungi-MSFT 41,861 Reputation points Microsoft Employee
    2023-03-29T13:02:13.3+00:00

    AMROUN Lysa I think you need to use ONNX format model file instead of pickle to use with ML.NET

    Please see this page from documentation on how to build an ONNX compatible model file and using the same with ML.NET

    I hope this helps!!

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful