ONNX → HAILO Conversion Error: ShapeInferenceError on MaxPool Operation

Hi everyone,

I’m encountering an issue when trying to convert an ONNX model (UCMNet v2) to Hailo format (HAR) using the hailo parser with Hailo8. The dataflow compiler version is 3.30 and 3.31. Here are the details:

When I run :

hailo parser onnx ucm_netv2.final.onnx

I obtain :

2025-06-29 01:15:29,094 - INFO - main.py:34 - Current Time: 01:15:29, 06/29/25 2025-06-29 01:15:30,126 - INFO - main.py:46 - CPU: Architecture: , Model: Intel(R) Xeon(R) Gold 6126 CPU @ 2.60GHz, Number Of Cores: 48, Utilization: 0.0% 2025-06-29 01:15:30,127 - INFO - main.py:50 - Memory: Total: 187GB, Available: 184GB 2025-06-29 01:15:30,127 - INFO - main.py:54 - System info: OS: Linux, Kernel: 5.10.0-35-amd64 2025-06-29 01:15:30,127 - INFO - main.py:55 - Hailo DFC Version: 3.30.0 2025-06-29 01:15:30,181 - INFO - main.py:60 - HailoRT Version: Not Installed 2025-06-29 01:15:30,199 - INFO - main.py:76 - PCIe: No Hailo PCIe device was found 2025-06-29 01:15:30,199 - INFO - main.py:109 - Running hailo parser onnx ucm_netv2.final.onnx 2025-06-29 01:15:30,206 - INFO - hailo_nn.py:1642 - Found a ‘.’ character in net_name, which isn’t supported. New net_name is ucm_netv2_final 2025-06-29 01:15:30,227 - INFO - parser.py:162 - Translation started on ONNX model ucm_netv2_final 2025-06-29 01:15:30,249 - INFO - parser.py:197 - Restored ONNX model ucm_netv2_final (completion time: 00:00:00.02) 2025-06-29 01:15:30,413 - INFO - parser.py:220 - Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:00.19) 2025-06-29 01:15:31,756 - WARNING - parser.py:318 - ONNX shape inference failed: [ONNXRuntimeError] : 1 : FAIL : Node (/model/MaxPool) Op (MaxPool) [ShapeInferenceError] Attribute dilations has incorrect size 2025-06-29 01:15:32,577 - INFO - parser.py:278 - Simplified ONNX model for a parsing retry attempt (completion time: 00:00:02.35) 2025-06-29 01:15:33,545 - WARNING - parser.py:318 - ONNX shape inference failed: [ONNXRuntimeError] : 1 : FAIL : Node (/model/MaxPool) Op (MaxPool) [ShapeInferenceError] Attribute dilations has incorrect size.

This appears twice, even after the parser attempts to simplify the model for retry.

Questions:

  1. Has anyone encountered this dilations error in the MaxPool operation before?
  2. Is there a known fix or workaround to resolve this in the ONNX model before parsing?
  3. Could this be related to a specific version of Hailo DFC or ONNX?

Any guidance or suggestions would be greatly appreciated.

Thanks in advance!

Best regards,
Louna

Welcome to the Hailo Community!

I asked ChatGPT about the error (just the part below) and it gave me an explanation of the issue and a few points worth trying. Give it a try yourself.

[ONNXRuntimeError] : 1 : FAIL : Node (/model/MaxPool) Op (MaxPool) [ShapeInferenceError] Attribute dilations has incorrect size 2025-06-29 01:15:32,577 - INFO - parser.py:278 - Simplified ONNX model for a parsing retry attempt (completion time: 00:00:02.35) 2025-06-29 01:15:33,545 - WARNING - parser.py:318 - ONNX shape inference failed: [ONNXRuntimeError] : 1 : FAIL : Node (/model/MaxPool) Op (MaxPool) [ShapeInferenceError] Attribute dilations has incorrect size.

Hello,

  1. Can you share your ONNX model opset version?
  2. Can you include a minimal ONNX snippet or visualization of the offending MaxPool node (e.g., using Netron)?

A dump of that node would be

{
  "op_type": "MaxPool",
  "name": "/model/MaxPool",
  "attributes": {
    "kernel_shape": [2, 2],
    "strides": [2, 2],
    "dilations": [1]
  }
}

Could this be a known bug in the ONNX frontend?

Hey @Provost_Louna ,

The parser is getting stuck when it tries to extract metadata from your ONNX model because there’s a problem with the dilations attribute. Maybe you can tell the parser to skip that metadata extraction step entirely:

hailo parser onnx ucm_netv2.final.onnx \
  --disable-rt-metadata-extraction