Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Machine learning models with ONNX and .NET

Henk Boelman
November 10, 2022
180

Machine learning models with ONNX and .NET

Most machine learning models are trained in Python using frameworks like PyTorch and TensorFlow. You might expect that an application that runs the trained model would need to have all those frameworks installed. But does it need to? It does not! By converting your model to ONNX, you can run it in any supported language, including your .NET applications! ONNX (Open Neural Network Exchange) is an open standard for machine learning interoperability. It enables tools to work together by allowing them to share models in a commonly understood format. In this presentation we will show you how you can train a machine learning model using transfer learning in PyTorch, we’ll convert the model to ONNX, and we’ll use it in a .NET application.

Henk Boelman

November 10, 2022
Tweet

Transcript

  1. Machine learning models with ONNX and .NET Beatriz Stollnitz Principal

    Cloud Advocate @ Microsoft Henk Boelman Senior Cloud Advocate @ Microsoft
  2. What is Computer Vision? Computer vision is a field of

    artificial intelligence that trains computers to interpret and understand the visual world.
  3. In transfer learning, a model trained for one task is

    used as a starting point for a different task. What is Transfer Learning?
  4. PyTorch is an open-source deep learning framework originally developed by

    Meta AI, and now part of the Linux Foundation. What is PyTorch?
  5. ONNX is an open format built to represent machine learning

    models. It defines a common set of operators and a common file format to enable AI developers to use models with a variety of frameworks, tools, runtimes, and compilers. What is ONNX?
  6. What is Azure Machine Learning? Set of Azure Cloud Services

    Python SDK AML Studio or Interface of your choice That enables you to:  Prepare Data  Manage Models  Build Models  Track Experiments  Train Models  Deploy Models
  7. ML Pipelines An Azure Machine Learning pipeline is an independently

    executable workflow of a complete machine learning task. Subtasks are encapsulated as a series of steps within the pipeline. An Azure Machine Learning pipeline can be as simple as one that calls a Python script, so may do just about anything. Workflows of steps that can use Data Sources, Datasets and run on Compute targets
  8. Create a step / component Input Output Runs a script

    on a Compute Target in a Docker container. Parameters
  9. Create a pipeline Dataset of Simpsons Images Train the Model

    with a PyTorch model Register the model Blob Storage Account Model Management model Convert Model To ONNX
  10. Azure ML Designer What is the Azure ML Designer? AML

    Designer is an UI interface which enables you to build machine learning pipelines with drag-n-drop experience and simplify the publishment and deployment of your pipelines.