I run hailomz and get error

here is my computer os: Linux PC 5.15.0-116-generic #126~20.04.1-Ubuntu SMP Mon Jul 1 15:40:07 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux, and run in Python 3.8.10

And I install

Name: hailo-model-zoo
Version: 2.12.0
Summary: Hailo machine learning utilities and examples
Home-page: https://hailo.ai/
Author: Hailo team
Author-email: [email protected]
License: MIT
Location: /home/jiahao/hailo_env/lib/python3.8/site-packages
Requires: detection-tools, scikit-image, scikit-learn, pycocotools, pillow, motmetrics, opencv-python, Cython, scipy, termcolor, imageio, numpy, matplotlib, omegaconf, lap, tqdm
Required-by: 

from here and install

Name: hailo-dataflow-compiler
Version: 3.28.0
Summary: Hailo Dataflow Compiler
Home-page: https://hailo.ai/
Author: Hailo team
Author-email: [email protected]
License: None
Location: /home/jiahao/hailo_env/lib/python3.8/site-packages
Requires: pygraphviz, verboselogs, numpy, testresources, importlib-metadata, pyparsing, py, keras, tflite, packaging, setuptools, tqdm, msgpack, tensorflow-probability, pandas, jupyter, typing-extensions, argcomplete, wheel, onnx, absl-py, tabulate, ipython, networkx, scipy, jsonref, contextlib2, grpcio, jedi, matplotlib, pwlf, Pillow, h5py, six, protobuf, tensorboard, py-cpuinfo, prompt-toolkit, disjoint-set, flatbuffers, onnxruntime, gast, onnx-tf, onnxsim, jsonschema, pydantic, tensorflow, parso, PyYAML, prettytable, future
Required-by: 

from here

so I input command hailomz parse yolov8n and I get yolov8n.har, and then I input hailomz optimize yolov8n --har /PATH/yolov8n.har, and I get error below:

(hailo_env) jiahao@PC:~/Downloads$ hailomz optimize yolov8n --har /home/jiahao/Downloads/yolov8n.har --hw-arch hailo8l
<Hailo Model Zoo INFO> Start run for network yolov8n ...
<Hailo Model Zoo INFO> Initializing the hailo8l runner...
[warning] hw_arch from HAR is hailo8 but client runner was initialized with hailo8l. Using hailo8l
Traceback (most recent call last):
  File "/home/jiahao/hailo_env/bin/hailomz", line 8, in <module>
    sys.exit(main())
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main.py", line 122, in main
    run(args)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main.py", line 111, in run
    return handlers[args.command](args)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main_driver.py", line 220, in optimize
    model_script = _extract_model_script_path(
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main_driver.py", line 55, in _extract_model_script_path
    else resolve_alls_path(networks_alls_script, hw_arch=hw_arch, performance=performance)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/core/main_utils.py", line 38, in resolve_alls_path
    return path_resolver.resolve_alls_path(Path(hw_arch) / Path("base" if not performance else "performance") / path)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/utils/path_resolver.py", line 29, in resolve_alls_path
    raise FileNotFoundError("no alls found for requested hw_arch")
FileNotFoundError: no alls found for requested hw_arch

someone help

Here is the output when I intpu

hailomz parse yolov8n

output

(hailo_env) jiahao@PC:~/Downloads$ hailomz parse yolov8n
In file included from /home/jiahao/hailo_env/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1948,
                 from /home/jiahao/hailo_env/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /home/jiahao/hailo_env/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from /home/jiahao/.pyxbld/temp.linux-x86_64-cpython-38/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/core/postprocessing/cython_utils/cython_nms.c:1246:
/home/jiahao/hailo_env/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
<Hailo Model Zoo INFO> Start run for network yolov8n ...
<Hailo Model Zoo INFO> Initializing the runner...
[info] Translation started on ONNX model yolov8n
[info] Restored ONNX model yolov8n (completion time: 00:00:00.05)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:00.30)
[info] NMS structure of yolov8 (or equivalent architecture) was detected.
[info] In order to use HailoRT post-processing capabilities, these end node names should be used: /model.22/cv2.0/cv2.0.2/Conv /model.22/cv3.0/cv3.0.2/Conv /model.22/cv2.1/cv2.1.2/Conv /model.22/cv3.1/cv3.1.2/Conv /model.22/cv2.2/cv2.2.2/Conv /model.22/cv3.2/cv3.2.2/Conv.
[info] Start nodes mapped from original model: 'images': 'yolov8n/input_layer1'.
[info] End nodes mapped from original model: '/model.22/cv2.0/cv2.0.2/Conv', '/model.22/cv3.0/cv3.0.2/Conv', '/model.22/cv2.1/cv2.1.2/Conv', '/model.22/cv3.1/cv3.1.2/Conv', '/model.22/cv2.2/cv2.2.2/Conv', '/model.22/cv3.2/cv3.2.2/Conv'.
[info] Translation completed on ONNX model yolov8n (completion time: 00:00:00.86)
[info] Saved HAR to: /home/jiahao/Downloads/yolov8n.har

I think you need to run the first command when you get the har with --hw-arch hailo8l.

It seems not work

(hailo_env) jiahao@PC:~/Downloads$ hailomz parse yolov8n --hw-arch hailo8l
<Hailo Model Zoo INFO> Start run for network yolov8n ...
<Hailo Model Zoo INFO> Initializing the runner...
[info] Translation started on ONNX model yolov8n
[info] Restored ONNX model yolov8n (completion time: 00:00:00.05)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:00.25)
[info] NMS structure of yolov8 (or equivalent architecture) was detected.
[info] In order to use HailoRT post-processing capabilities, these end node names should be used: /model.22/cv2.0/cv2.0.2/Conv /model.22/cv3.0/cv3.0.2/Conv /model.22/cv2.1/cv2.1.2/Conv /model.22/cv3.1/cv3.1.2/Conv /model.22/cv2.2/cv2.2.2/Conv /model.22/cv3.2/cv3.2.2/Conv.
[info] Start nodes mapped from original model: 'images': 'yolov8n/input_layer1'.
[info] End nodes mapped from original model: '/model.22/cv2.0/cv2.0.2/Conv', '/model.22/cv3.0/cv3.0.2/Conv', '/model.22/cv2.1/cv2.1.2/Conv', '/model.22/cv3.1/cv3.1.2/Conv', '/model.22/cv2.2/cv2.2.2/Conv', '/model.22/cv3.2/cv3.2.2/Conv'.
[info] Translation completed on ONNX model yolov8n (completion time: 00:00:00.81)
[info] Saved HAR to: /home/jiahao/Downloads/yolov8n.har
(hailo_env) jiahao@PC:~/Downloads$ hailomz optimize yolov8n --har /home/jiahao/Downloads/yolov8n.har
<Hailo Model Zoo INFO> Start run for network yolov8n ...
<Hailo Model Zoo INFO> Initializing the hailo8 runner...
[warning] hw_arch from HAR is hailo8l but client runner was initialized with hailo8. Using hailo8
Traceback (most recent call last):
  File "/home/jiahao/hailo_env/bin/hailomz", line 8, in <module>
    sys.exit(main())
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main.py", line 122, in main
    run(args)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main.py", line 111, in run
    return handlers[args.command](args)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main_driver.py", line 220, in optimize
    model_script = _extract_model_script_path(
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main_driver.py", line 55, in _extract_model_script_path
    else resolve_alls_path(networks_alls_script, hw_arch=hw_arch, performance=performance)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/core/main_utils.py", line 38, in resolve_alls_path
    return path_resolver.resolve_alls_path(Path(hw_arch) / Path("base" if not performance else "performance") / path)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/utils/path_resolver.py", line 29, in resolve_alls_path
    raise FileNotFoundError("no alls found for requested hw_arch")
FileNotFoundError: no alls found for requested hw_arch

To resolve the warning you’re seeing, it’s best to explicitly specify the hardware architecture when running the commands.

The warning message indicates that the HAR file is configured for the hailo8l architecture, but the client runner was initialized with the default hailo8 architecture.

To ensure the commands use the correct architecture, you should run both commands with the --hw-arch flag, like this:

--hw-arch hailo8l

This will ensure the commands are executed with the hailo8l architecture, matching the configuration of the HAR file and avoiding the warning message.

It does not work.

(hailo_env) jiahao@PC:~/Downloads$ rm -rf yolov8n.har 
(hailo_env) jiahao@PC:~/Downloads$ hailomz parse yolov8n --hw-arch hailo8l
<Hailo Model Zoo INFO> Start run for network yolov8n ...
<Hailo Model Zoo INFO> Initializing the runner...
[info] Translation started on ONNX model yolov8n
[info] Restored ONNX model yolov8n (completion time: 00:00:00.05)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:00.25)
[info] NMS structure of yolov8 (or equivalent architecture) was detected.
[info] In order to use HailoRT post-processing capabilities, these end node names should be used: /model.22/cv2.0/cv2.0.2/Conv /model.22/cv3.0/cv3.0.2/Conv /model.22/cv2.1/cv2.1.2/Conv /model.22/cv3.1/cv3.1.2/Conv /model.22/cv2.2/cv2.2.2/Conv /model.22/cv3.2/cv3.2.2/Conv.
[info] Start nodes mapped from original model: 'images': 'yolov8n/input_layer1'.
[info] End nodes mapped from original model: '/model.22/cv2.0/cv2.0.2/Conv', '/model.22/cv3.0/cv3.0.2/Conv', '/model.22/cv2.1/cv2.1.2/Conv', '/model.22/cv3.1/cv3.1.2/Conv', '/model.22/cv2.2/cv2.2.2/Conv', '/model.22/cv3.2/cv3.2.2/Conv'.
[info] Translation completed on ONNX model yolov8n (completion time: 00:00:00.78)
[info] Saved HAR to: /home/jiahao/Downloads/yolov8n.har
(hailo_env) jiahao@PC:~/Downloads$ hailomz optimize yolov8n --har /home/jiahao/Downloads/yolov8n.har --hw-arch hailo8l
<Hailo Model Zoo INFO> Start run for network yolov8n ...
<Hailo Model Zoo INFO> Initializing the hailo8l runner...
Traceback (most recent call last):
  File "/home/jiahao/hailo_env/bin/hailomz", line 8, in <module>
    sys.exit(main())
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main.py", line 122, in main
    run(args)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main.py", line 111, in run
    return handlers[args.command](args)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main_driver.py", line 220, in optimize
    model_script = _extract_model_script_path(
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/main_driver.py", line 55, in _extract_model_script_path
    else resolve_alls_path(networks_alls_script, hw_arch=hw_arch, performance=performance)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/core/main_utils.py", line 38, in resolve_alls_path
    return path_resolver.resolve_alls_path(Path(hw_arch) / Path("base" if not performance else "performance") / path)
  File "/home/jiahao/hailo_env/lib/python3.8/site-packages/hailo_model_zoo/utils/path_resolver.py", line 29, in resolve_alls_path
    raise FileNotFoundError("no alls found for requested hw_arch")
FileNotFoundError: no alls found for requested hw_arch

And I try to solve it use docker:

jiahao@PC:~/Downloads$ sudo bash hailo_ai_sw_suite_docker_run.sh 
Starting new container
Running Hailo AI SW suite Docker image with the folowing Docker command:
docker run --privileged --net=host -e DISPLAY=:0 -e XDG_RUNTIME_DIR= --device=/dev/dri:/dev/dri --ipc=host --group-add 44 -v /dev:/dev -v /lib/firmware:/lib/firmware -v /lib/modules:/lib/modules -v /lib/udev/rules.d:/lib/udev/rules.d -v /usr/src:/usr/src -v /tmp/hailo_docker.xauth:/home/hailo/.Xauthority -v /tmp/.X11-unix/:/tmp/.X11-unix/ --name hailo_ai_sw_suite_2024-07_container -v /var/run/docker.sock:/var/run/docker.sock -v /etc/machine-id:/etc/machine-id:ro -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket -v /home/jiahao/Downloads/shared_with_docker/:/local/shared_with_docker:rw -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro -ti hailo_ai_sw_suite_2024-07:1

==========
== CUDA ==
==========

CUDA Version 11.8.0

Container image Copyright (c) 2016-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the NVIDIA Deep Learning Container License.
By pulling and using the container, you accept the terms and conditions of this license:
https://developer.nvidia.com/ngc/nvidia-deep-learning-container-license

A copy of this license is made available in this container at /NGC-DL-CONTAINER-LICENSE for your convenience.

WARNING: The NVIDIA Driver was not detected.  GPU functionality will not be available.
   Use the NVIDIA Container Toolkit to start this container with GPU support; see
   https://docs.nvidia.com/datacenter/cloud-native/ .



Welcome to Hailo AI Software Suite Container
To list available commands, please type:

----------------------------------------------------

HailoRT:                hailortcli -h
Dataflow Compiler:      hailo -h
Hailo Model Zoo:        hailomz -h
TAPPAS:                 hailo_run_app -h

----------------------------------------------------


bash: /local/workspace/tappas/scripts/bash_completion.d/python-argcomplete: No such file or directory

And then I enter a container, and I run command below:

(hailo_virtualenv) hailo@PC:/local/workspace$ hailomz parse yolov8n --hw-arch hailo8l
[info] First time Hailo Dataflow Compiler is being used. Checking system requirements... (this might take a few seconds)
[Warning] It is recommended to have 32 GB of RAM, while this system has only 29 GB.
[Info] No GPU connected.
Component   Requirement      Found
==========  ==========       ==========  ==========
OS          Ubuntu           Ubuntu      Required
Release     20.04            20.04       Required
Package     python3-tk       V           Required
Package     graphviz         V           Required
Package     libgraphviz-dev  V           Required
Package     python3.8-dev    V           Required
RAM(GB)     16               29          Required
RAM(GB)     32               29          Recommended
CPU-Arch    x86_64           x86_64      Required
CPU-flag    avx              V           Required
Var:CC      unset            unset       Required
Var:CXX     unset            unset       Required
Var:LD      unset            unset       Required
Var:AS      unset            unset       Required
Var:AR      unset            unset       Required
Var:LN      unset            unset       Required
Var:DUMP    unset            unset       Required
Var:CPY     unset            unset       Required
In file included from /local/workspace/hailo_virtualenv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1948,
                 from /local/workspace/hailo_virtualenv/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 from /local/workspace/hailo_virtualenv/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:5,
                 from /home/hailo/.pyxbld/temp.linux-x86_64-cpython-38/local/workspace/hailo_model_zoo/hailo_model_zoo/core/postprocessing/cython_utils/cython_nms.c:1246:
/local/workspace/hailo_virtualenv/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
<Hailo Model Zoo INFO> Start run for network yolov8n ...
<Hailo Model Zoo INFO> Initializing the runner...
[info] Translation started on ONNX model yolov8n
[info] Restored ONNX model yolov8n (completion time: 00:00:00.05)
[info] Extracted ONNXRuntime meta-data for Hailo model (completion time: 00:00:00.21)
[info] NMS structure of yolov8 (or equivalent architecture) was detected.
[info] In order to use HailoRT post-processing capabilities, these end node names should be used: /model.22/cv2.0/cv2.0.2/Conv /model.22/cv3.0/cv3.0.2/Conv /model.22/cv2.1/cv2.1.2/Conv /model.22/cv3.1/cv3.1.2/Conv /model.22/cv2.2/cv2.2.2/Conv /model.22/cv3.2/cv3.2.2/Conv.
[info] Start nodes mapped from original model: 'images': 'yolov8n/input_layer1'.
[info] End nodes mapped from original model: '/model.22/cv2.0/cv2.0.2/Conv', '/model.22/cv3.0/cv3.0.2/Conv', '/model.22/cv2.1/cv2.1.2/Conv', '/model.22/cv3.1/cv3.1.2/Conv', '/model.22/cv2.2/cv2.2.2/Conv', '/model.22/cv3.2/cv3.2.2/Conv'.
[info] Translation completed on ONNX model yolov8n (completion time: 00:00:00.78)

Then I get a differet error

(hailo_virtualenv) hailo@PC:/local/workspace$ hailomz optimize yolov8n --har /local/workspace/yolov8n.har --hw-arch hailo8l
<Hailo Model Zoo INFO> Start run for network yolov8n ...
<Hailo Model Zoo INFO> Initializing the hailo8l runner...
<Hailo Model Zoo INFO> Preparing calibration data...
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 224, in optimize
    calib_feed_callback = prepare_calibration_data(
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py", line 280, in prepare_calibration_data
    calib_feed_callback = make_calibset_callback(network_info, preproc_callback, calib_path)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py", line 241, in make_calibset_callback
    data_feed_cb = _make_dataset_callback(network_info, preproc_callback, calib_path, dataset_name)
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py", line 218, in _make_dataset_callback
    return _make_data_feed_callback(
  File "/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py", line 197, in _make_data_feed_callback
    raise FileNotFoundError(f"Couldn't find dataset in {data_path}. Please refer to docs/DATA.rst.")
FileNotFoundError: Couldn't find dataset in /local/shared_with_docker/.hailomz/models_files/coco/2021-06-18/coco_calib2017.tfrecord. Please refer to docs/DATA.rst.

We have here two different issues :
For the first run, the “alls” file is missing. You can search for the “alls” file for YOLOv8n in the model zoo and change it as needed, then provide it manually in the command line.

For the second run, the dataset required for the model to be compiled is missing. You can either search for the dataset in the Hailo model zoo or download it from COCO.

I use command hailo as follow but get one error

Here is I use hailomz command:

Hi @jiahao.li,

The pickle error you see happens because the DFC does not accept tfrecords, only .npy files.

The error that you see with the ModelZoo tool (hailomz optimize) is due to an incorrect path to the nms config. Please ensure that the JSON path passed in the nms_postprocess command line in the model script is correct.

Do you have a complete operational process for a model? I mean to compile the model to hef, and get .so lib.

We recommend checking our tutorials, which you can run with:

hailo tutorial

Besides that, you can also check out our documentation.

I’m getting a similar error:

(venv) quickium@gustavo:~/hailo/hailo_model_zoo$ hailomz compile  yolov8m --classes 9 --calib-path ../dataset/images --hw-arch hailo8l --har ../yolov8m.h
ar
<Hailo Model Zoo INFO> Start run for network yolov8m ...
<Hailo Model Zoo INFO> Initializing the hailo8l runner...
Traceback (most recent call last):
  File "/home/quickium/hailo/venv/bin/hailomz", line 8, in <module>
    sys.exit(main())
  File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main.py", line 122, in main
    run(args)
  File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main.py", line 111, in run
    return handlers[args.command](args)
  File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main_driver.py", line 250, in compile
    _ensure_optimized(runner, logger, args, network_info)
  File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main_driver.py", line 84, in _ensure_optimized
    model_script = _extract_model_script_path(
  File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/main_driver.py", line 55, in _extract_model_script_path
    else resolve_alls_path(networks_alls_script, hw_arch=hw_arch, performance=performance)
  File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/core/main_utils.py", line 38, in resolve_alls_path
    return path_resolver.resolve_alls_path(Path(hw_arch) / Path("base" if not performance else "performance") / path)
  File "/home/quickium/hailo/venv/lib/python3.10/site-packages/hailo_model_zoo/utils/path_resolver.py", line 29, in resolve_alls_path
    raise FileNotFoundError("no alls found for requested hw_arch")
FileNotFoundError: no alls found for requested hw_arch

Plase explain what it this “alls” and where/how to configure it for a custon trained yolo model.

Had this same issue and what helped me it was clone hailo_model_zoo and cd hailo_model_zoo; pip install -e .
This is written in README to do so .