Loading…
Glossary term
An open format for representing machine learning models so they can move between tools.
ONNX is an open file format for describing a machine learning model's structure and weights so it can move between frameworks and run on different runtimes and hardware.
A model trained in PyTorch can be exported and run in an optimized engine elsewhere.
Export a PyTorch model to ONNX
import torch
example = torch.randn(1, 3, 224, 224)
torch.onnx.export(model, example, "model.onnx")It reduces lock-in and simplifies deploying models across many platforms.