Who is this for?

This is an advanced topic for developers who want to build, optimize, and deploy machine learning models using ONNX on Arm64-based platforms such as Raspberry Pi, Arm-based laptops, cloud instances, or Android smartphones.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Explain what ONNX is and how it enables model portability across ML frameworks
  • Build and export a neural network model in Python to ONNX format
  • Run inference using ONNX Runtime on Arm64 platforms
  • Apply model optimization techniques to improve performance
  • Deploy an optimized ONNX model in an Android application

Prerequisites

Before starting, you will need the following:

  • A development machine with Python 3.10 or 3.11 installed (Prebuilt ONNX Runtime packages for Arm platforms don’t yet support Python 3.12)
  • Basic familiarity with PyTorch or TensorFlow
  • An Arm64 device such as a Raspberry Pi or Android smartphone
  • Android Studio (required only for the final deployment section)

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll train a compact digit recognizer, export it to ONNX, and deploy it with ONNX Runtime on Arm platforms. First, you’ll generate a synthetic Sudoku dataset, validate PyTorch and ONNX Runtime results, and apply optimizations such as layer fusion. Then, you’ll select and verify execution providers for edge devices and Android, including NNAPI when available.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
How do I know ONNX Runtime is using the right execution provider on my device?
Verify the provider list reported by ONNX Runtime. You should see a CPU execution provider on Arm64 systems and NNAPI on Android when available before proceeding.
What artifacts should I expect after exporting the trained model to ONNX?
You’ll have an ONNX model file produced by the Dynamo-based exporter and your original PyTorch checkpoint. Use both to run inference and compare results across frameworks.
What should I check if ONNX Runtime predictions don't match PyTorch?
Confirm that preprocessing matches training: 28×28 grayscale inputs and consistent label mapping (0 = blank, 1–9 = digits). Re-run the validation and compare predictions and the confusion matrix to identify where outputs diverge.
Can I follow the steps if I'm using Python 3.12?
Prebuilt ONNX Runtime packages for Arm platforms don’t support Python 3.12 yet, so use Python 3.10 or 3.11.
How do I decide which execution provider to use for deployment?
Use the CPU execution provider for Arm64 development and edge devices, and NNAPI on Android when it’s available.
Next