Converting Machine Learning models to ONNX for use in Windows ML

In Artificial Intelligence, Mobile Development by Christian HissibiniLeave a Comment

If you’re using Microsoft Cognitive Toolkit on Azure to build and run machine learning models, you should already have access to ONNX, because it’s built into every version after 2.3.1, and it’ll soon be part of the Visual Studio Tools for AI. All you need to do to export a model is to choose ONNX as your export format, something you can do with a single line of Python or C# code. You don’t even need to write the export statement into your training application; it can even be a call from an Azure Notebook or a statement in an Azure machine learning pipeline.

Microsoft also provides its own tools to convert models from some other formats, like Apple’s Core ML, to ONNX. Microsoft’s WinMLTools is a Python package, so you can use it with existing machine learning tools, like Anaconda. By integrating with familiar machine learning development environments, you can mix cross-platform data science skills with Windows developers—using the same machine learning models that now run on popular mobile platforms, as well on Windows.

Leave a Comment