Hi all,
I am trying to convert a Yolo-NAS medium model in onnx format to HEF. I get a rather undescriptive error and I’m not sure where to go from here.
Has anyone successfully converted a Yolo-NAS model before? Anything I can try to fix this error?
Thanks!
Here is my code:
from hailo_sdk_client import ClientRunner
model_name = "m5"
onnx_path = "./5_3_25_medium.onnx"
chosen_hw_arch = "hailo8r"
runner = ClientRunner(hw_arch=chosen_hw_arch)
hn, npz = runner.translate_onnx_model(onnx_path, model_name,
end_node_names=["/mode/heads/Conv_2", "/mode/heads/Sigmoid", "/mode/heads/Conv_1", "/mode/heads/Conv"])
The output:
[info] Translation started on ONNX model m5
[info] Restored ONNX model m5 (completion time: 00:00:00.66)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:01.19)
[info] Unable to simplify the model: 'NoneType' object has no attribute 'in_valid_subgraph'
Traceback (most recent call last):
File "/home/localadmin/Code/Hailo/parse.py", line 8, in <module>
hn, npz = runner.translate_onnx_model(onnx_path, model_name,
File "/home/localadmin/Code/Hailo/.venv/lib/python3.10/site-packages/hailo_sdk_common/states/states.py", line 16, in wrapped_func
return func(self, *args, **kwargs)
File "/home/localadmin/Code/Hailo/.venv/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py", line 1158, in translate_onnx_model
parser.translate_onnx_model(
File "/home/localadmin/Code/Hailo/.venv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 242, in translate_onnx_model
raise e from None
File "/home/localadmin/Code/Hailo/.venv/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/localadmin/Code/Hailo/.venv/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/localadmin/Code/Hailo/.venv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py", line 340, in parse_model_to_hn
converter = ONNXConverter(
File "/home/localadmin/Code/Hailo/.venv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/onnx_translator/onnx_translator.py", line 170, in __init__
super().__init__(
File "/home/localadmin/Code/Hailo/.venv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/edge_nn_translator.py", line 27, in __init__
super().__init__(graph, start_node_names, end_node_names)
File "/home/localadmin/Code/Hailo/.venv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/translator.py", line 51, in __init__
self._calculate_valid_subgraph_scope()
File "/home/localadmin/Code/Hailo/.venv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/translator.py", line 388, in _calculate_valid_subgraph_scope
current_vertex.in_valid_subgraph = True
AttributeError: 'NoneType' object has no attribute 'in_valid_subgraph'