---
title: "When a model won’t load"
url: https://recursiveai.org/onemodel/cookbook/missing-operators/
description: "What OneModel reports when an ONNX model uses an operator it doesn’t implement, or one without an exact kernel in exact mode, and how to read the error."
version: "0.3.0-preview.1"
---

# When a model won’t load

What OneModel reports when an ONNX model uses an operator it doesn’t implement, or one without an exact kernel in exact mode, and how to read the error.

Two small models, made with the `onnx` Python package: `unsupported.onnx` uses `DeformConv` and `TfIdfVectorizer`, which the 0.3.0 preview doesn’t implement, and `wave.onnx` uses `Cos`, which has a fast kernel but no exact one. `broken_models.py`:

```python
import numpy as np, onnx
from onnx import helper as h, TensorProto as T, numpy_helper as nh
# unsupported.onnx: two operators the 0.3.0 preview has no kernel for
g = h.make_graph(
    [h.make_node("DeformConv", ["x", "w", "offset"], ["y"]),
     h.make_node("TfIdfVectorizer", ["ids"], ["tfidf"], mode="TF", min_gram_length=1, max_gram_length=1,
                 max_skip_count=0, ngram_counts=[0], ngram_indexes=[0], pool_int64s=[1])],
    "unsupported",
    [h.make_tensor_value_info("x", T.FLOAT, [1, 1, 3, 3]), h.make_tensor_value_info("w", T.FLOAT, [1, 1, 2, 2]),
     h.make_tensor_value_info("offset", T.FLOAT, [1, 8, 2, 2]), h.make_tensor_value_info("ids", T.INT64, [4])],
    [h.make_tensor_value_info("y", T.FLOAT, None), h.make_tensor_value_info("tfidf", T.FLOAT, None)])
onnx.save(h.make_model(g, opset_imports=[h.make_opsetid("", 22)], ir_version=10), "unsupported.onnx")
# wave.onnx: Cos has a fast kernel but no exact one in 0.3.0
g = h.make_graph([h.make_node("Cos", ["t"], ["y"])], "wave",
    [h.make_tensor_value_info("t", T.FLOAT, [4])], [h.make_tensor_value_info("y", T.FLOAT, [4])])
onnx.save(h.make_model(g, opset_imports=[h.make_opsetid("", 17)], ir_version=8), "wave.onnx")
print("ok")
```

```csharp
using RecursiveAI.OneModel;
using RecursiveAI.OneModel.Graph;

try
{
    Model.Load("unsupported.onnx");
}
catch (SessionException e)
{
    Console.WriteLine($"{e.Kind}: {e.Message}");
    foreach (string op in e.Operators) Console.WriteLine($"  missing: {op}");
}

try
{
    Model.Load("wave.onnx", new SessionOptions { Mode = ExecutionMode.Exact });
}
catch (SessionException e)
{
    Console.WriteLine($"{e.Kind}: {e.Message}");
}

using var fast = Model.Load("wave.onnx");   // the same model runs in fast mode
Console.WriteLine(string.Join(", ", fast.Run([0f, 1f, 2f, 3f]).Select(x => x.ToString("F6"))));
```

```text
UnsupportedOperator: The model uses operators this library does not implement: DeformConv (opset 22), TfIdfVectorizer (opset 22).
  missing: DeformConv (opset 22)
  missing: TfIdfVectorizer (opset 22)
ExactModeUnavailable: Exact mode is not available: no exact kernel exists for Cos. Use ExecutionMode.Fast or remove these operators.
1.000000, 0.540302, -0.416147, -0.989992
```

## Reading the error

- `SessionException.Kind` is `UnsupportedOperator` or `ExactModeUnavailable`; `Operators` lists every operator involved, each with its opset, so one load tells you everything a model needs.
- The check happens in `Model.Load`, before any input is read. Nothing half-runs.
- Other kinds: `InvalidModel` (the graph is malformed, with the node name), `InvalidInput` (a wrong name, type or shape at `Run`), `Unsupported` and `Disposed`. A file that isn’t valid ONNX at all is an `OnnxImportException`.

Which operators pass the ONNX backend tests, in fast and in exact mode, and the reason for every gap, is in [conformance](https://recursiveai.org/onemodel/docs/conformance/).
