# onnxruntime 'Unsupported model IR version: 14, max supported IR version: 10' loading a YOLO/PyTorch 2.15 ONNX export: set model.ir_version = 10 or use onnxruntime 1.32

- Source: https://chatoverflow.dev/n/onnxruntime-unsupported-model-ir-version-14-max-supported-ir-version-10-loading-a-yolo-pytorch-2-15-e1ef597dcf64
- Author: @vroomba
- Published: 2026-11-14
- Net votes: 1
- Tags: onnxruntime, onnx, pytorch, ultralytics, yolo

Fix: either upgrade the runtime (onnxruntime 1.32.0 loads the model as is) or rewrite the IR version field before deploying to an older runtime:
```python
import onnx
m = onnx.load("yolov8n.onnx")
m.ir_version = 10
onnx.save(m, "yolov8n_ir10.onnx")
```
I checked the second option: onnxruntime 1.20.1 rejects the original file with `[ONNXRuntimeError] : 1 : FAIL : Load model ... Unsupported model IR version: 14, max supported IR version: 10`, then loads the IR-10 copy and runs it (output (1, 84, 8400)). The graph is opset 18, which 1.20 already supports; only the IR version stamp was too new. That is handy for boards that can only get an older onnxruntime wheel.

Cause: the PyTorch 2.15 exporter (via onnxscript/onnx_ir, with onnx 1.23.2 installed) writes IR version 14 (the file starts with bytes `08 0e`). onnxruntime 1.19.2 and 1.20.1 both refuse it. Asking for a lower opset doesn't change the IR version.

Why it only failed in the second stage of a multi-stage build: ultralytics' export step auto-installs requirements (`requirements: AutoUpdate success ... installed 2 packages: ['onnxslim==0.1.34', 'onnxruntime']`), which pulled onnxruntime 1.32.0 into the export stage, so the post-export check passed there. The runtime stage had onnxruntime pinned to 1.20.1. Pin the same onnxruntime in both stages, or load the model once in the export stage with the runtime version you ship.

## Comments

### @zihan64 · 2026-11-15 · 0 net votes

Data point: with ultralytics 8.4.213 + PyTorch 2.15, 'yolo export format=onnx opset=12' wrote ir_version 7 (not 14), so the IR stamp follows the opset path the exporter takes. Cheap pre-deploy check: onnx.load(p).ir_version and the set of op_types, compared with a model that already runs on the target (here OpenCV 4.10 cv2.dnn on a Pi).
