[Parsing Error] It seems that a problem occurs as the dimensions change.

ChatGPT said:

I’m working on zero-shot detection with YOLO-World.

I’ve verified that the ONNX model runs, and I’m now at the stage of converting it into a HEF file.

During that process, I ran into an issue at the parsing step.

The code I used is as follows(This code is based on the Parsing section of the Hailo Tutorial):

# General imports used throughout the tutorial
import tensorflow as tf
from IPython.display import SVG

# import the ClientRunner class from the hailo_sdk_client package
from hailo_sdk_client import ClientRunner

#For Hailo-8 devices
chosen_hw_arch = "hailo8"

#Choose the ONNX file
onnx_model_name = "yolov8s-jevois-512x288-8c-img"
onnx_path = "./yolov8s-jevois-512x288-8c-img.onnx"

runner = ClientRunner(hw_arch=chosen_hw_arch)
hn, npz = runner.translate_onnx_model(
    onnx_path,
    onnx_model_name,
    start_node_names=[
                      "images",
                      "/model.12/attn/Transpose_1_output_0",
                      "/model.15/attn/Transpose_1_output_0",
                      "/model.18/attn/Transpose_1_output_0",
                      "/model.21/attn/Transpose_1_output_0",
                      "/model.22/cv4.0/Div_output_0"
                     ],
    end_node_names=[
                    "/model.22/cv2.0/cv2.0.2/Conv_output_0",
                    "/model.22/cv4.0/Add_output_0",
                    "/model.22/cv2.1/cv2.1.2/Conv_output_0",
                    "/model.22/cv4.1/Add_output_0",
                    "/model.22/cv2.2/cv2.2.2/Conv_output_0",
                    "/model.22/cv4.2/Add_output_0"
                   ],
    net_input_shapes={
                      "images": [1, 3, 288, 512],
                      "/model.12/attn/Transpose_1_output_0": [1, 4, 32, 8],
                      "/model.15/attn/Transpose_1_output_0": [1, 2, 32, 8],
                      "/model.18/attn/Transpose_1_output_0": [1, 4, 32, 8],
                      "/model.21/attn/Transpose_1_output_0": [1, 8, 32, 8],
                      "/model.22/cv4.0/Div_output_0": [1, 8, 512]
                     },
)

hailo_model_har_name = f"{onnx_model_name}_parsed.har"
runner.save_har(hailo_model_har_name)

And the following error occurred.

2025-08-19 12:31:46.651285: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2025-08-19 12:31:46.689249: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2025-08-19 12:31:47.337141: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
[info] Translation started on ONNX model yolov8s-jevois-512x288-8c-img
[info] Restored ONNX model yolov8s-jevois-512x288-8c-img (completion time: 00:00:00.24)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:01.37)
[info] Simplified ONNX model for a parsing retry attempt (completion time: 00:00:03.71)
Traceback (most recent call last):
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 239, in translate_onnx_model
    parsing_results = self._parse_onnx_model_to_hn(
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 320, in _parse_onnx_model_to_hn
    return self.parse_model_to_hn(
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 371, in parse_model_to_hn
    fuser = HailoNNFuser(converter.convert_model(), net_name, converter.end_node_names)
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/translator.py", line 83, in convert_model
    self._create_layers()
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/edge_nn_translator.py", line 39, in _create_layers
    self._add_direct_layers()
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/edge_nn_translator.py", line 162, in _add_direct_layers
    raise ParsingWithRecommendationException(
hailo_sdk_client.model_translator.exceptions.ParsingWithRecommendationException: Parsing failed. The errors found in the graph are:
 UnsupportedShuffleLayerError in op /model.12/attn/Reshape_3: Failed to determine type of layer to create in node /model.12/attn/Reshape_3
 UnsupportedShuffleLayerError in op /model.15/attn/Reshape_3: Failed to determine type of layer to create in node /model.15/attn/Reshape_3
 UnsupportedShuffleLayerError in op /model.18/attn/Reshape_3: Failed to determine type of layer to create in node /model.18/attn/Reshape_3
 UnsupportedShuffleLayerError in op /model.21/attn/Reshape_3: Failed to determine type of layer to create in node /model.21/attn/Reshape_3
 UnsupportedReduceMaxLayerError in op /model.12/attn/ReduceMax: Failed to create reduce max layer at vertex /model.12/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
 UnsupportedReduceMaxLayerError in op /model.15/attn/ReduceMax: Failed to create reduce max layer at vertex /model.15/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
 UnsupportedReduceMaxLayerError in op /model.18/attn/ReduceMax: Failed to create reduce max layer at vertex /model.18/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
 UnsupportedReduceMaxLayerError in op /model.21/attn/ReduceMax: Failed to create reduce max layer at vertex /model.21/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
 UnsupportedShuffleLayerError in op /model.18/attn/Reshape_2: Failed to determine type of layer to create in node /model.18/attn/Reshape_2
 UnsupportedShuffleLayerError in op /model.15/attn/Reshape_2: Failed to determine type of layer to create in node /model.15/attn/Reshape_2
 UnsupportedShuffleLayerError in op /model.21/attn/Reshape_2: Failed to determine type of layer to create in node /model.21/attn/Reshape_2
 UnsupportedShuffleLayerError in op /model.12/attn/Reshape_2: Failed to determine type of layer to create in node /model.12/attn/Reshape_2
Please try to parse the model again, using these start node names: /model.22/cv4.0/Div_output_0, images
Please try to parse the model again, using these end node names: /model.12/attn/Reshape_4, /model.12/m.0/cv2/act/Mul, /model.22/cv4.0/Transpose_1, /model.12/Slice, /model.12/Slice_1, /model.9/cv2/act/Mul, /model.4/cv2/act/Mul, /model.12/attn/Transpose

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/local/shared_with_docker/YOLO-jevois-split/hailo_parsing.py", line 16, in <module>
    hn, npz = runner.translate_onnx_model(
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_common/states/states.py", line 16, in wrapped_func
    return func(self, *args, **kwargs)
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py", line 1187, in translate_onnx_model
    parser.translate_onnx_model(
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 280, in translate_onnx_model
    parsing_results = self._parse_onnx_model_to_hn(
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 320, in _parse_onnx_model_to_hn
    return self.parse_model_to_hn(
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 371, in parse_model_to_hn
    fuser = HailoNNFuser(converter.convert_model(), net_name, converter.end_node_names)
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/translator.py", line 83, in convert_model
    self._create_layers()
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/edge_nn_translator.py", line 39, in _create_layers
    self._add_direct_layers()
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/edge_nn_translator.py", line 162, in _add_direct_layers
    raise ParsingWithRecommendationException(
hailo_sdk_client.model_translator.exceptions.ParsingWithRecommendationException: Parsing failed. The errors found in the graph are:
 UnsupportedShuffleLayerError in op /model.21/attn/Reshape_3: Failed to determine type of layer to create in node /model.21/attn/Reshape_3
 UnsupportedShuffleLayerError in op /model.12/attn/Reshape_3: Failed to determine type of layer to create in node /model.12/attn/Reshape_3
 UnsupportedShuffleLayerError in op /model.15/attn/Reshape_3: Failed to determine type of layer to create in node /model.15/attn/Reshape_3
 UnsupportedShuffleLayerError in op /model.18/attn/Reshape_3: Failed to determine type of layer to create in node /model.18/attn/Reshape_3
 UnsupportedReduceMaxLayerError in op /model.21/attn/ReduceMax: Failed to create reduce max layer at vertex /model.21/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
 UnsupportedReduceMaxLayerError in op /model.12/attn/ReduceMax: Failed to create reduce max layer at vertex /model.12/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
 UnsupportedReduceMaxLayerError in op /model.15/attn/ReduceMax: Failed to create reduce max layer at vertex /model.15/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
 UnsupportedReduceMaxLayerError in op /model.18/attn/ReduceMax: Failed to create reduce max layer at vertex /model.18/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
 UnsupportedShuffleLayerError in op /model.18/attn/Reshape_2: Failed to determine type of layer to create in node /model.18/attn/Reshape_2
 UnsupportedShuffleLayerError in op /model.15/attn/Reshape_2: Failed to determine type of layer to create in node /model.15/attn/Reshape_2
 UnsupportedShuffleLayerError in op /model.21/attn/Reshape_2: Failed to determine type of layer to create in node /model.21/attn/Reshape_2
 UnsupportedShuffleLayerError in op /model.12/attn/Reshape_2: Failed to determine type of layer to create in node /model.12/attn/Reshape_2
Please try to parse the model again, using these start node names: /model.22/cv4.0/Div_output_0, images
Please try to parse the model again, using these end node names: /model.12/attn/Reshape_4, /model.12/m.0/cv2/act/Mul, /model.22/cv4.0/Transpose_1, /model.12/Slice, /model.12/Slice_1, /model.9/cv2/act/Mul, /model.4/cv2/act/Mul, /model.12/attn/Transpose

Looking closely at this error:

UnsupportedShuffleLayerError in op /model.12/attn/Reshape_2: Failed to determine type of layer to create in node /model.12/attn/Reshape_2
UnsupportedReduceMaxLayerError in op /model.12/attn/ReduceMax: Failed to create reduce max layer at vertex /model.12/attn/ReduceMax. Reduce max is only supported on the features axis, and with keepdim=True
UnsupportedShuffleLayerError in op /model.12/attn/Reshape_3: Failed to determine type of layer to create in node /model.12/attn/Reshape_3

You can see that the same structure appears, with only the model part changed.

Below is one example image.

The commonality among the layers where UnsupportedShuffleLayerError occurs is that the dimensions change.

  • For Reshape_2, it changes from (1×2×36×64×32) to (1×2×2304×32),

  • For Reshape_3, it changes from (1×2×2304×8) to (1×2×36×64×8),

  • For ReduceMax, it changes from (1×2×36×64×8) to (1×2×36×64).

All of these are layers that transform between 4D and 5D.

Therefore, I thought these changes were the issue.

Questions:

  1. In such cases, is there an alternative operation that can be used?

  2. It’s possible that the issue isn’t what I predicted. In this ONNX model, there are inputs located in the middle of the network—could that be causing the problem?

Thank you for reading.

Hi @Park_Hanyu,

Thank you the detailed question, and analysis. Indeed 5D tensors are not supported in our SW toolset.
Unfortunately at this time, YOLO-world is not yet fully supported

1 Like