YAML config for compiling custom OCR ONNX model to HEF (Hailo Model Zoo v2.15)

Hi everyone,

I’m working on deploying a custom OCR model based on LPRNet to the Hailo-8 chip using the Hailo Model Zoo v2.15.0. I’ve trained and exported the model as ONNX and am now trying to generate the .hef file using hailomz compile --yaml <path_to_yaml>.

My yaml looks this like:

network:
  network_name: testmodel

paths:
  network_path:
    - <model e.g. test.onnx (is in same directory as yaml and where the cmd is done)>
  alls_script: null

parser:
  nodes: ["input", "output"]
  start_node_shapes:
    input: [1, 1, 32, 160]

preprocessing:
  network_type: classification

evaluation:
  dataset_name: dummy
  classes: 37
  labels_offset: 0

targets:
  - device: hailo8

I get at the moment an error which tells me that the paths.url is missing. This parameter is not described in the docu and when I add url: “” or url: or url: null it complaince that the url should start with http://

:man_raising_hand: Questions

  1. What is the correct YAML configuration to compile a local ONNX model (custom LPRNet-based OCR)?
  2. Do I need to include url, alls_script, or anything else to avoid download attempts?
  3. What’s the simplest working config for compiling an ONNX model to HEF using only local files?

Thank you very much for your help in advance!

Hey @Felix_Rottmann ,

Welcome to the Hailo Community!

The error you’re seeing (paths.url missing) happens because your YAML is being treated as a remote model configuration. For local model compilation, you shouldn’t rely on URL-based download logic at all.

Here’s how to fix it:

Minimal YAML for Local ONNX Model Compilation

network:
  network_name: testmodel

paths:
  network_path:
    - test.onnx  # make sure this path is correct (relative or absolute)
  alls_script: null

parser:
  nodes: ["input", "output"]
  start_node_shapes:
    input: [1, 1, 32, 160]  # match your model input exactly

preprocessing:
  network_type: classification

evaluation:
  dataset_name: dummy
  classes: 37
  labels_offset: 0

targets:
  - device: hailo8

Key point: Don’t include url at all. Having it there makes the model zoo try to download something, which you don’t need for local models.

Recommended Flow: Parse → Optimize → Compile

  1. Parse (Convert to Hailo Format)

    hailomz parse --ckpt test.onnx --yaml config.yaml
    
    • Creates a .har file (Hailo’s parsed model format)
    • You can validate with hailomz eval --target emulator
  2. Optimize (Quantize and Tune)

    hailomz optimize --yaml config.yaml
    
    • Handles quantization and graph optimizations
    • Make sure you have calibration data (>1024 images work best)
  3. Compile (Generate HEF)

    hailomz compile --yaml config.yaml
    
    • Creates the final .hef file for Hailo-8 runtime

The 3-stage approach helps you catch issues early and validate each step!
Let me know if you hit anymore errors in doing it in this flow !

Hi @omria ,

thanks for your fast reply!

I tested your steps but still receive an error when I start parsing with the now CRNN Lite Model. Hope it have no impact on the yaml config… :see_no_evil_monkey:

(hailo_virtualenv) hailo@test:/local/workspace/custo_models$ hailomz parse --ckpt test_crnn.onnx --yaml test_crnn.yaml
<Hailo Model Zoo INFO> Start run for network test_crnn ...
<Hailo Model Zoo INFO> Initializing the runner...
Traceback (most recent call last):
  File "/local/workspace/hailo_virtualenv/bin/hailomz", line 33, in <module>
    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 handlers[args.command](args)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py", line 201, in parse
    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 126, in parse_model
    raise Exception(f"Encountered error during parsing: {err}") from None
Exception: Encountered error during parsing: Expecting value: line 1 column 1 (char 0)

Do you know this error and can help me to solve it?

By the optimize cmd I receive this error:

Traceback (most recent call last):
  File "/local/workspace/hailo_virtualenv/bin/hailomz", line 33, in <module>
    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 handlers[args.command](args)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py", line 211, in optimize
    if args.calib_path is None and network_info.quantization.calib_set is None:
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  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 351, in __getattr__
    return self._get_impl(
  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.ConfigAttributeError: Missing key quantization
    full_key: quantization
    object_type=dict

And the compile returns still the url error…

<Hailo Model Zoo INFO> Start run for network uldnet_crnn ...
<Hailo Model Zoo INFO> Initializing the hailo8 runner...
Traceback (most recent call last):
  File "/local/workspace/hailo_virtualenv/bin/hailomz", line 33, in <module>
    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 handlers[args.command](args)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/main_driver.py", line 248, 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
    ckpt_path = download_model(network_info, logger)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py", line 86, in download_model
    url = network_info.paths.url
  File "/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/omegaconf/dictconfig.py", line 355, in __getattr__
    self._format_and_raise(
  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 351, in __getattr__
    return self._get_impl(
  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.ConfigAttributeError: Missing key url
    full_key: paths.url
    object_type=dict

Can you help me to solve this issues? I have now two yolo5 and one CRNN lite model which I would like to compile and run on the hailo8. The models are well and it would be good to bring them on the Hailo so that the use case is working together with the TPU from Hailo :right_facing_fist: :left_facing_fist:

Best regards from Germany and thank you very much for your support! :smiling_face_with_sunglasses:
Felix Rottmann