<aside>
💡 A guide on how to convert your PyTorch model to ONNX
</aside>
(optional) Exporting a Model from PyTorch to ONNX and Running it using ONNX Runtime - PyTorch Tutorials 1.11.0+cu102 documentation
PyTorch’s official documentation
- [Export to ONNX] One way to convert a PyTorch model to ONNX is to use a conversion script.
NOTE: An alternative approach is to export the model to ONNX after inference in PyTorch. Then use ONNX to make inference again and compare the results to validate the converted model.
- [Simplify ONNX] Another really helpful tool is the ONNX simplifier - https://github.com/daquexian/onnx-simplifier.
As the name suggests, it simplifies an ONNX by reading the computation graph and removing redundant operators.