DFC yaml issue - Syntax?

Working on converting a custom model, but I can’t get the yaml file right. It keeps complaining about the nodes section under parser and not finding key.0. I have optimized, simplified etc and gotten a valid onnx file.

here is the yaml:
network:
network_name: encoder
version: 1.0

model:
name: encoder
version: 1.0
architecture: hailo8l
inputs:
- name: x
shape: [1, 80, 3000]
type: float32

outputs:
- name: out
shape: [1500, 1024]
type: float32

parser:
start_node_names:
- x
end_node_names:
- out
net_input_shapes:
x: [1, 80, 3000]
start_node_shapes:
x: [1, 80, 3000]
end_node_shapes:
out: [1500, 1024]

nodes:
- name: x
op_type: Input
shape: [1, 80, 3000]
index: 0

- name: out
  op_type: Output
  input:
    - x
  shape: [1500, 1024]
  index: 1

quantization:
type: dynamic
calib_set: null

cfg:
architecture: hailo8l
input_tensor_shapes:
x: [1, 80, 3000]
output_tensor_shapes:
out: [1500, 1024]

Here is error from compile:

Initializing the hailo8l runner…
[info] Translation started on ONNX model whisper_medium_encoder
[info] Restored ONNX model whisper_medium_encoder (completion time: 00:00:00.16)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:03.45)
[info] Simplified ONNX model for a parsing retry attempt (completion time: 00:00:43.19)
Traceback (most recent call last):
File “/local/workspace/hailo_virtualenv/bin/hailomz”, line 33, in
sys.exit(load_entry_point(‘hailo-model-zoo’, ‘console_scripts’, ‘hailomz’)())
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/main.py”, line 122, in main
run(args)
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/main.py”, line 111, in run
return handlersargs.command
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py”, line 250, in compile
_ensure_optimized(runner, logger, args, network_info)
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py”, line 73, in _ensure_optimized
_ensure_parsed(runner, logger, network_info, args)
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py”, line 108, in _ensure_parsed
parse_model(runner, network_info, ckpt_path=args.ckpt_path, results_dir=args.results_dir, logger=logger)
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py”, line 99, in parse_model
model_name = translate_model(runner, network_info, ckpt_path, tensor_shapes=start_node_shapes)
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/utils/parse_utils.py”, line 28, in translate_model
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 1158, 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 276, 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 316, 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 356, in parse_model_to_hn
converter = ONNXConverter(
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/onnx_translator/onnx_translator.py”, line 174, in init
super().init(
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/edge_nn_translator.py”, line 31, in init
super().init(graph, start_node_names, end_node_names)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/translator.py”, line 55, in init
self._calculate_valid_subgraph_scope()
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/translator.py”, line 391, in _calculate_valid_subgraph_scope
wrong_names = [self._end_node_names[i] for i in wrong_indices]
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/model_translator/translator.py”, line 391, in
wrong_names = [self._end_node_names[i] for i in wrong_indices]
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/dictconfig.py”, line 375, in getitem
self._format_and_raise(key=key, value=None, cause=e)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/base.py”, line 231, in _format_and_raise
format_and_raise(
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/_utils.py”, line 899, in format_and_raise
_raise(ex, cause)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/_utils.py”, line 797, in _raise
raise ex.with_traceback(sys.exc_info()[2]) # set env var OC_CAUSE=1 for full trace
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/dictconfig.py”, line 369, in getitem
return self._get_impl(key=key, default_value=DEFAULT_MARKER)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/dictconfig.py”, line 442, in _get_impl
node = self._get_child(
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/basecontainer.py”, line 73, in _get_child
child = self._get_node(
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/dictconfig.py”, line 480, in _get_node
raise ConfigKeyError(f"Missing key {key!s}")
omegaconf.errors.ConfigKeyError: Missing key 0
full_key: parser.nodes[1].0
object_type=dic

nodes:

  • x
  • out

Fixed it

1 Like