- I install the DFC. Works fine converting yolo model.
- I have segformer b0 onnx model. weight 12 mb.
- I am getting this error from the DFC:
/home/nuchailo1/anaconda3/envs/hailocompiler/bin/python /home/nuchailo1/PycharmProjects/hailocompiler/hcompiler.py
[info] Translation started on ONNX model mapcoresegformer_small
[info] Restored ONNX model mapcoresegformer_small (completion time: 00:00:00.05)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:00.71)
[info] Start nodes mapped from original model: ‘input’: ‘mapcoresegformer_small/input_layer1’.
[info] End nodes mapped from original model: ‘/backbone/layers.1.0/Transpose’.
[info] Translation completed on ONNX model mapcoresegformer_small (completion time: 00:00:01.49)
[warning] hw_arch parameter not given, using the default hw_arch hailo8.
If another device is the target, please run again using one of hailo8, hailo8r, hailo8l, hailo15h, hailo15m
Traceback (most recent call last):
File “/home/nuchailo1/PycharmProjects/hailocompiler/hcompiler.py”, line 12, in
hn, npz = runner.translate_onnx_model(onnx_path, onnx_model_name,start_node_names=start_node,end_node_names=end_node)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/states/states.py”, line 16, in wrapped_func
return func(self, *args, **kwargs)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py”, line 881, in translate_onnx_model
return self._finalize_parsing(parser.return_data)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py”, line 937, in _finalize_parsing
self.set_hn(return_data[‘hn_data’])
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/states/states.py”, line 16, in wrapped_func
return func(self, *args, **kwargs)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py”, line 1356, in set_hn
self._sdk_backend = self._generate(hn)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py”, line 136, in _generate
hn = self._load_hn(hn)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py”, line 1363, in _load_hn
return HailoNN.from_hn(hn)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hailo_nn.py”, line 1370, in from_hn
return HNImporter().from_hn(hn_json)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hailo_nn.py”, line 1602, in from_hn
return self.from_parsed_hn(json.loads(ensure_str(hn_json)))
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hailo_nn.py”, line 1585, in from_parsed_hn
self._add_layers()
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hailo_nn.py”, line 1643, in _add_layers
layer_parsed = self.create_layer(layer_hn, layer_name)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hailo_nn.py”, line 1653, in create_layer
layer_parsed = cls.TYPE_TO_CLASS[layer_hn[‘type’]].from_hn(layer_hn)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hn_layers/fused_conv2d.py”, line 246, in from_hn
layer = super(FusedConv2DLayer, cls).from_hn(hn)
File “/home/nuchailo1/anaconda3/envs/hailocompiler/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hn_layers/conv2d.py”, line 399, in from_hn
raise UnsupportedModelError(
hailo_sdk_common.hailo_nn.exceptions.UnsupportedModelError: Input features and output features must be a multiply of groups for conv layer mapcoresegformer_small/conv14 (translated from /backbone/layers.1.0/Transpose)
Specifically the error is coming from the following check:
** if hn[‘type’] in [LayerType.conv.value, LayerType.deconv.value]:**
** group_sizes_sum = sum(layer.group_sizes)**
** if layer.kernel_shape[2] % group_sizes_sum != 0 or layer.kernel_shape[3] % group_sizes_sum != 0:**
** raise UnsupportedModelError(**
** f’Input features and output features must be a multiply of groups for {layer.full_name_msg}'**
** )**
in conv2d.py file
How I can overcome this error?
I can simply comment this check and the har file is created but i guess it is important since the hef model created from this file is not working after commenting these lines.
Any Ideas?
All Best…
David