Rule Reference

ONNX Doctor includes 64 rules across multiple providers (10 with auto-fix 🔧).

ONNX Rules

Code

Name

Severity

Fix

Target

Message

ONNX001

empty-graph-name

error

🔧

graph

Graph name of the root graph is empty.

ONNX002

empty-initializer-name

error

🔧

graph

Initializer name is empty.

ONNX003

unsorted-graph-nodes

error

🔧

graph

Graph nodes are not in topological order.

ONNX004

unknown-node-input

error

graph

Node input is not produced by a previous node or a graph input.

ONNX005

experimental-op

warning

graph

Node uses an experimental operator.

ONNX006

duplicate-value-name

error

graph

Multiple values share the same name within a graph.

ONNX007

graph-output-not-produced

error

🔧

graph

Graph output is not produced by any node in the graph.

ONNX008

graph-ssa-violation

error

graph

Value name is assigned multiple times, violating SSA form.

ONNX009

initializer-name-conflict

error

graph

Initializer name conflicts with a subgraph input name.

ONNX010

invalid-ir-version

error

model

Model ir_version is missing or invalid.

ONNX011

ir-version-too-new

warning

model

Model ir_version is newer than the checker supports.

ONNX012

duplicate-metadata-keys

error

model

Model has duplicate keys in metadata_props.

ONNX013

missing-default-opset

error

model

Model (IR version >= 3) is missing opset import for the default ONNX domain.

ONNX014

unexpected-opset-import

error

model

Model (IR version < 3) should not have opset_import specified.

ONNX015

missing-opset-for-domain

error

node

No opset imported for the node’s operator domain.

ONNX016

deprecated-op

warning

node

Node uses a deprecated operator.

ONNX017

unregistered-op

error

node

No operator schema found for this op type and opset version.

ONNX018

missing-value-type

info

value

Value has no type annotation.

ONNX019

undefined-value-dtype

error

value

Value’s tensor type has UNDEFINED dtype.

ONNX020

undefined-tensor-dtype

error

value

Tensor dtype is UNDEFINED.

ONNX021

external-tensor-absolute-path

error

value

External tensor location is an absolute path (must be relative).

ONNX022

external-tensor-empty-location

error

value

External tensor location is empty.

ONNX023

external-tensor-outside-model-dir

error

value

External tensor path points outside the model directory.

ONNX024

external-tensor-inaccessible

error

value

External tensor file does not exist or is not accessible.

ONNX025

external-tensor-not-file

error

value

External tensor path is not a regular file.

ONNX026

function-empty-name

error

function

Function name is empty.

ONNX027

function-missing-domain

error

function

Function has no domain (required for IR version >= 8).

ONNX028

function-duplicate-inputs

error

function

Function has duplicate input names.

ONNX029

function-duplicate-outputs

error

function

Function has duplicate output names.

ONNX030

function-duplicate-attributes

error

function

Function has duplicate attribute names.

ONNX031

unsorted-function-nodes

error

🔧

function

Function nodes are not in topological order.

ONNX032

function-ssa-violation

error

function

Function is not in SSA form — a value name is assigned multiple times.

ONNX033

function-opset-mismatch

error

function

Function opset import is incompatible with the model’s opset import.

ONNX034

graph-input-missing-type

error

graph

Graph input is missing type information.

ONNX035

graph-input-missing-shape

error

graph

Graph input is missing shape information.

ONNX036

graph-output-missing-type

error

graph

Graph output is missing type information.

ONNX037

graph-output-missing-shape

error

graph

Graph output is missing shape information.

ONNX038

subgraph-variable-shadowing

error

graph

Subgraph value name shadows a name from an outer scope.

ONNX039

ref-attr-outside-function

error

graph

Reference attribute can only appear in function nodes, not in the main graph or its subgraphs.

ONNX101

duplicate-graph-input

error

graph

Duplicate Value object in graph inputs.

ONNX102

duplicate-graph-output

error

🔧

graph

Duplicate Value object in graph outputs.

ONNX103

empty-value-name

warning

🔧

graph

Value has no name set.

ONNX104

initializer-missing-const-value

error

graph

Initializer Value has no const_value set.

ORT Rules

Code

Name

Severity

Fix

Target

Message

ORT001

operator-unsupported

error

node

Operator is not supported by the execution provider in ONNX Runtime.

ORT002

operator-version-unsupported

error

node

Operator at this opset version is not supported by the execution provider.

ORT003

node-type-inconsistent

error

node

Type constraint mismatch for operator inputs/outputs.

ORT004

type-unsupported

error

node

Data type is not supported by the execution provider for this operator.

ORT005

typestr-not-in-schema

error

node

Type string is not defined in the operator schema.

PB Rules

Code

Name

Severity

Fix

Target

Message

PB001

non-unique-initializer-name

error

graph

Tensor initializer names within a graph are not unique.

PB002

non-unique-sparse-initializer-name

error

graph

Sparse tensor initializer names are not unique.

PB003

attribute-multiple-value-fields

error

node

Attribute contains more than one value field.

PB004

attribute-ref-has-value

error

node

Attribute referring to a parent attribute has its own value field set.

PB005

tensor-data-field-mismatch

error

value

Tensor data field does not match the specified data type.

PB006

zero-element-tensor-has-data

error

value

A zero-element tensor should not contain data.

PB007

multi-value-field-tensor

error

value

Tensor with non-zero elements has multiple value fields set.

PB008

string-data-in-raw-data

error

value

STRING data stored in raw_data field.

PB009

externally-stored-tensor-has-data

error

value

Externally stored tensor has inline data fields set.

PB010

invalid-sparse-indices-size

error

value

Sparse tensor indices size does not match NNZ count.

PB011

sparse-indices-out-of-range

error

value

Sparse tensor indices are out of range.

PB012

unsorted-sparse-indices

error

value

Sparse tensor indices are not sorted.

PB013

sparse-indices-not-lexicographic

error

value

Sparse tensor indices are not in lexicographic order.

SIM Rules

Code

Name

Severity

Fix

Target

Message

SIM001

unused-functions

info

🔧

model

Model contains functions that are not referenced by any node.

SIM002

unused-opset-imports

info

🔧

model

Model imports opsets that are not used by any node.

SIM003

unused-node

info

🔧

node

Node outputs are not consumed.