According to the Dataflow Compiler documentation, it appears that both SpaceToDepth and DepthToSpace are supported.
DepthToSpace corresponds to PyTorch’s PixelShuffle, but SpaceToDepth seems to need to be implemented using tensor slice + concat.
When I looked at the ONNX graph of yolov5m in the hailo_model_zoo, it was implemented using slice + concat.
I configured the input part of my model as shown in the picture, but I encountered an error during parsing, as indicated in the log below.
Is there a solution to this issue?
[info] Translation started on ONNX model model
[info] Restored ONNX model model (completion time: 00:00:00.02)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:00.13)
[info] Simplified ONNX model for a parsing retry attempt (completion time: 00:00:01.57)
Traceback (most recent call last):
File “/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py”, line 220, in translate_onnx_model
parsing_results = self._parse_onnx_model_to_hn(
File “/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py”, line 300, in _parse_onnx_model_to_hn
return self.parse_model_to_hn(
File “/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py”, line 352, in parse_model_to_hn
hailo_nn = fuser.convert_model()
File “/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/model_translator/fuser/fuser.py”, line 97, in convert_model
self._run_pre_fusing_flow()
File “/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/model_translator/fuser/fuser.py”, line 122, in _run_pre_fusing_flow
self._handle_downsample_by_two_with_slice()
File “/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/model_translator/fuser/fuser.py”, line 4994, in _handle_downsample_by_two_with_slice
raise BackendFuserException(
hailo_sdk_client.model_translator.fuser.exceptions.BackendFuserException: base slice layer base_slice3 (translated from /Slice_1) is unsupported due to strided slicing: height_slice=[0, 540, 1], width_slice=[0, 1920, 2], features_slice=[0, 3, 1]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/media/SSD/WORKSPACE/emb/hailo/src/hailo_example.py", line 198, in <module>
parsing(model_name)
File "/media/SSD/WORKSPACE/emb/hailo/src/hailo_example.py", line 68, in parsing
hn, npz = runner.translate_onnx_model(
File "/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_common/states/states.py", line 16, in wrapped_func
return func(self, *args, **kwargs)
File "/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py", line 1158, in translate_onnx_model
parser.translate_onnx_model(
File "/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 260, in translate_onnx_model
parsing_results = self._parse_onnx_model_to_hn(
File "/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 300, in _parse_onnx_model_to_hn
return self.parse_model_to_hn(
File "/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 352, in parse_model_to_hn
hailo_nn = fuser.convert_model()
File "/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/model_translator/fuser/fuser.py", line 97, in convert_model
self._run_pre_fusing_flow()
File "/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/model_translator/fuser/fuser.py", line 122, in _run_pre_fusing_flow
self._handle_downsample_by_two_with_slice()
File "/home/moon/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/model_translator/fuser/fuser.py", line 4994, in _handle_downsample_by_two_with_slice
raise BackendFuserException(
hailo_sdk_client.model_translator.fuser.exceptions.BackendFuserException: base slice layer base_slice3 (translated from /Slice_1) is unsupported due to strided slicing: height_slice=[0, 540, 1], width_slice=[0, 1920, 2], features_slice=[0, 3, 1]