Error in converting MixFormer_v2 onnx into hef using hailo parser

Hi all!
My initial plan was to use the MixFormer_v2 tracker on raspberry pi 5 (using AI HAT+). I downloaded the pre-trained model’s onnx file from their github repository. Now I have errors while using the hailo parser for conversion into a hef model. Using the parser on other onnx models works fine.

The hardware I currently use to convert the onnx file is:
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04

Command:
hailo parser onnx PATH/mixformer_v2.onnx --hw-arch hailo8l --net-name mixformer_v2 --har-path PATH/mixformer_v2.har --input-format img_t=1,3,112,112 --input-format img_ot=1,3,112,112 --input-format img_search=1,3,224,224 --end-node-names Reshape_471 Sigmoid_472 [info] Current Time: 11:38:08, 07/16/25 [info] CPU: Architecture: x86_64, Model: Intel(R) Core i7-7700 CPU @ 3.60GHz, Number Of Cores: 8, Utilization: 3.1% [info] Memory: Total: 15GB, Available: 8GB [info] System info: OS: Linux, Kernel: 5.15.0-139-generic
[info] Hailo DFC Version: 3.30.0
[info] HailoRT Version: Not Installed
[info] PCIe: No Hailo PCIe device was found
[info] Running hailo parser onnx PATH/mixformer_v2.onnx --hw-arch hailo8l --net-name mixformer_v2 --har-path PATH/mixformer_v2.har --input-format img_t=1,3,112,112 --input-format img_ot=1,3,112,112 --input-format img_search=1,3,224,224 --end-node-names Reshape_471 Sigmoid_472
Traceback (most recent call last): File “PATH/hailo_env/lib/python3.10/site-packages/hailo_sdk_client/tools/parser_cli.py”, line 200, in run self.net_input_format = parse_dict_or_list_arg(args.input_format, arg_name=“input_format”) File “PATH/hailo_env/lib/python3.10/site-packages/hailo_sdk_client/tools/cmd_utils/utils.py”, line 22, in parse_dict_or_list_arg values_dict[arg_split[0]] = parse_arg_value(arg_split[1], arg_name) File “PATH/hailo_env/lib/python3.10/site-packages/hailo_sdk_client/tools/cmd_utils/utils.py”, line 47, in parse_arg_value raise CmdUtilsBaseUtilError(f"Can’t parse {value} as {arg_name}, plase verify and try again.") hailo_sdk_client.tools.cmd_utils.base_utils.CmdUtilsBaseUtilError: Can’t parse 1,3,224,224 as input_format, plase verify and try again. The above exception was the direct cause of the following exception: Traceback (most recent call last): File “PATH/hailo_env/bin/hailo”, line 8, in sys.exit(main()) File “PATH/hailo_env/lib/python3.10/site-packages/hailo_sdk_client/tools/cmd_utils/main.py”, line 111, in main ret_val = client_command_runner.run() File “PATH/hailo_env/lib/python3.10/site-packages/hailo_sdk_client/tools/cmd_utils/baseutils.py”, line 68, in run return self.run(argv) File “PATH/hailo_env/lib/python3.10/site-packages/hailo_sdk_client/tools/cmd_utils/baseutils.py”, line 89, in run return args.func(args) File “PATH/hailo_env/lib/python3.10/site-packages/hailo_sdk_client/tools/parsercli.py”, line 206, in run raise ParserCLIException(err.args[0]) from err hailo_sdk_client.tools.parser_cli.ParserCLIException: Can’t parse 1,3,224,224 as input_format, plase verify and try again.
I tryed giving the input format in the JSON, YAML formats and in one parameter, but nothing works.
I would appreciate any help. Thanks in advance!

Hey @Gohar_Khachatryan ,

Welcome to the Hailo Community!

The error:

Can't parse 1,3,224,224 as input_format, please verify and try again.

You’re hitting this because --input-format isn’t for specifying tensor dimensions - it’s for defining the layout ordering of your data (like BCHW, BHWC, etc.). Our parser automatically extracts static shapes from ONNX files, or you can override them with a different flag.

Here’s how to fix it:

Option 1: Let the parser handle it automatically
If your ONNX already has fixed input shapes baked in, just drop the --input-format flag completely:

hailo parser onnx PATH/mixformer_v2.onnx \
    --hw-arch hailo8l \
    --net-name mixformer_v2 \
    --har-path PATH/mixformer_v2.har \
    --start-node-names img_t img_ot img_search \
    --end-node-names Reshape_471 Sigmoid_472

Option 2: Override shapes explicitly
If you need to change the input dimensions, use --net-input-shapes with square brackets:

hailo parser onnx PATH/mixformer_v2.onnx \
    --hw-arch hailo8l \
    --net-name mixformer_v2 \
    --har-path PATH/mixformer_v2.har \
    --start-node-names img_t img_ot img_search \
    --end-node-names Reshape_471 Sigmoid_472 \
    --net-input-shapes \
      img_t=[1,3,112,112],\
      img_ot=[1,3,112,112],\
      img_search=[1,3,224,224]

This corresponds to our Python API’s net_input_shapes parameter.

When to actually use --input-format
Only use this flag when you need to specify dimension ordering:

--input-format img_t=BCHW \
--input-format img_ot=BCHW \
--input-format img_search=BCHW

Bottom line:

  • Need to change shapes? → --net-input-shapes with brackets
  • Need to change layout? → --input-format name=FORMAT
  • ONNX has static shapes? → omit both flags

Hope this clears it up!

Hi, @omria !
I tried both of your options, and here is what I got.


ParsingWithRecommendationException( hailo_sdk_client.model_translator.exceptions.ParsingWithRecommendationException: Parsing failed. The errors found in the graph are: UnexpectedNodeError in op 
Squeeze_316: Unexpected node Squeeze_316 (Squeeze) UnexpectedNodeError in op 
Squeeze_317: Unexpected node Squeeze_317 (Squeeze) UnexpectedNodeError in op 
Squeeze_318: Unexpected node Squeeze_318 (Squeeze) UnexpectedNodeError in op
 Squeeze_319: Unexpected node Squeeze_319 (Squeeze) UnexpectedNodeError in op
 Squeeze_444: Unexpected node Squeeze_444 (Squeeze) UnexpectedNodeError in op Squeeze_445: Unexpected node Squeeze_445 (Squeeze) UnexpectedNodeError in op 
Squeeze_446: Unexpected node Squeeze_446 (Squeeze) UnexpectedNodeError in op
 Squeeze_447: Unexpected node Squeeze_447 (Squeeze) UnsupportedShuffleLayerError in op Reshape_471: Failed to determine type of layer to
 create in node Reshape_471 Please try to parse the model again, using these end node
 names: Split_314, Sigmoid_472 During handling of the above exception, another 
exception occurred: 
...
MisspellNodeError: Unable to find end node name: ['Reshape_471'], please verify and try again.

I believe this happens, because the parser is not able to recognize some layers( Maybe the problem is with the mixformer model?

As for the second option, I used the exact same command you sent, and got this:

hailo: error: unrecognized arguments: --net-input-shapes img_t=[1,3,112,112], img_ot=[1,3,112,112], img_search=[1,3,224,224]