Skip to content

Cannot create ONNXRuntimeAdapter for ONNX FP16 model #544

@itallix

Description

@itallix

Describe the bug

Creating ONNXRuntimeAdapter for FP16 ONNX model fails with TypeError.

The model is exported in the Geti Tune app with the following snippet:

exported_onnx_model_path = getitune_engine.export(
            checkpoint=model_checkpoint_path,
            export_format=ExportFormat.ONNX,
            export_precision=Precision.FP16,
        )

The ONNX model in FP32 format works.

Steps to Reproduce

  1. Train any detection model in Geti Tune
  2. Download ONNX artifact (available in FP16 format after training succeeds)
  3. Try to create ONNXRuntimeAdapter with downloaded model:
from model_api.adapters import ONNXRuntimeAdapter

inference_adapter = ONNXRuntimeAdapter("./mobilenetv2/model.onnx", ort_options={"providers" : ['CPUExecutionProvider']})

Stacktrace:

TypeError                                 Traceback (most recent call last)
[/tmp/ipykernel_25233/3774717722.py](https://localhost:8080/#) in <cell line: 0>()
----> 1 inference_adapter = ONNXRuntimeAdapter("./mobilenetv2/model.onnx", ort_options={"providers" : ['CPUExecutionProvider']})
      2 ssd_model = SSD(inference_adapter=inference_adapter, preload=True)
      3 results = ssd_model(input_data)

4 frames
[/usr/local/lib/python3.12/dist-packages/onnxruntime/tools/symbolic_shape_infer.py](https://localhost:8080/#) in _get_shape_rank(self, node, idx)
    416 
    417     def _get_shape_rank(self, node, idx):
--> 418         return len(self._get_shape(node, idx))
    419 
    420     def _get_sympy_shape(self, node, idx):

TypeError: object of type 'NoneType' has no len()

ONNX_model.zip

Environment

  • OS: Ubuntu 22.04.5
  • OpenVINO version: 2026.1.0-21367-63e31528c62-releases/2026/1
  • Inference device model and memory: CPU AMD EPYC 7B12

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions