Rule Reference¶
ONNX Doctor includes 64 rules across multiple providers (10 with auto-fix 🔧).
ONNX Rules¶
Code |
Name |
Severity |
Fix |
Target |
Message |
|---|---|---|---|---|---|
|
error |
🔧 |
graph |
Graph name of the root graph is empty. |
|
|
error |
🔧 |
graph |
Initializer name is empty. |
|
|
error |
🔧 |
graph |
Graph nodes are not in topological order. |
|
|
error |
graph |
Node input is not produced by a previous node or a graph input. |
||
|
warning |
graph |
Node uses an experimental operator. |
||
|
error |
graph |
Multiple values share the same name within a graph. |
||
|
error |
🔧 |
graph |
Graph output is not produced by any node in the graph. |
|
|
error |
graph |
Value name is assigned multiple times, violating SSA form. |
||
|
error |
graph |
Initializer name conflicts with a subgraph input name. |
||
|
error |
model |
Model ir_version is missing or invalid. |
||
|
warning |
model |
Model ir_version is newer than the checker supports. |
||
|
error |
model |
Model has duplicate keys in metadata_props. |
||
|
error |
model |
Model (IR version >= 3) is missing opset import for the default ONNX domain. |
||
|
error |
model |
Model (IR version < 3) should not have opset_import specified. |
||
|
error |
node |
No opset imported for the node’s operator domain. |
||
|
warning |
node |
Node uses a deprecated operator. |
||
|
error |
node |
No operator schema found for this op type and opset version. |
||
|
info |
value |
Value has no type annotation. |
||
|
error |
value |
Value’s tensor type has UNDEFINED dtype. |
||
|
error |
value |
Tensor dtype is UNDEFINED. |
||
|
error |
value |
External tensor location is an absolute path (must be relative). |
||
|
error |
value |
External tensor location is empty. |
||
|
error |
value |
External tensor path points outside the model directory. |
||
|
error |
value |
External tensor file does not exist or is not accessible. |
||
|
error |
value |
External tensor path is not a regular file. |
||
|
error |
function |
Function name is empty. |
||
|
error |
function |
Function has no domain (required for IR version >= 8). |
||
|
error |
function |
Function has duplicate input names. |
||
|
error |
function |
Function has duplicate output names. |
||
|
error |
function |
Function has duplicate attribute names. |
||
|
error |
🔧 |
function |
Function nodes are not in topological order. |
|
|
error |
function |
Function is not in SSA form — a value name is assigned multiple times. |
||
|
error |
function |
Function opset import is incompatible with the model’s opset import. |
||
|
error |
graph |
Graph input is missing type information. |
||
|
error |
graph |
Graph input is missing shape information. |
||
|
error |
graph |
Graph output is missing type information. |
||
|
error |
graph |
Graph output is missing shape information. |
||
|
error |
graph |
Subgraph value name shadows a name from an outer scope. |
||
|
error |
graph |
Reference attribute can only appear in function nodes, not in the main graph or its subgraphs. |
||
|
error |
graph |
Duplicate Value object in graph inputs. |
||
|
error |
🔧 |
graph |
Duplicate Value object in graph outputs. |
|
|
warning |
🔧 |
graph |
Value has no name set. |
|
|
error |
graph |
Initializer Value has no const_value set. |
ORT Rules¶
Code |
Name |
Severity |
Fix |
Target |
Message |
|---|---|---|---|---|---|
|
error |
node |
Operator is not supported by the execution provider in ONNX Runtime. |
||
|
error |
node |
Operator at this opset version is not supported by the execution provider. |
||
|
error |
node |
Type constraint mismatch for operator inputs/outputs. |
||
|
error |
node |
Data type is not supported by the execution provider for this operator. |
||
|
error |
node |
Type string is not defined in the operator schema. |
PB Rules¶
Code |
Name |
Severity |
Fix |
Target |
Message |
|---|---|---|---|---|---|
|
error |
graph |
Tensor initializer names within a graph are not unique. |
||
|
error |
graph |
Sparse tensor initializer names are not unique. |
||
|
error |
node |
Attribute contains more than one value field. |
||
|
error |
node |
Attribute referring to a parent attribute has its own value field set. |
||
|
error |
value |
Tensor data field does not match the specified data type. |
||
|
error |
value |
A zero-element tensor should not contain data. |
||
|
error |
value |
Tensor with non-zero elements has multiple value fields set. |
||
|
error |
value |
STRING data stored in raw_data field. |
||
|
error |
value |
Externally stored tensor has inline data fields set. |
||
|
error |
value |
Sparse tensor indices size does not match NNZ count. |
||
|
error |
value |
Sparse tensor indices are out of range. |
||
|
error |
value |
Sparse tensor indices are not sorted. |
||
|
error |
value |
Sparse tensor indices are not in lexicographic order. |
SIM Rules¶
Code |
Name |
Severity |
Fix |
Target |
Message |
|---|---|---|---|---|---|
|
info |
🔧 |
model |
Model contains functions that are not referenced by any node. |
|
|
info |
🔧 |
model |
Model imports opsets that are not used by any node. |
|
|
info |
🔧 |
node |
Node outputs are not consumed. |