Dear Hailo Technical Support Team,
I am reaching out for assistance regarding an issue I am facing while trying to deploy a YOLOv8n model onto the Hailo-8L platform. Despite following the official documentation and guidelines, I have been unable to successfully convert and optimize the model.
Here are the steps I have taken:
- Successfully converted my YOLOv8n
.pt
model to the ONNX format.
- Attempted to use the following command for Hailo model compilation and quantization:
hailomz compile yolov8n \
--ckpt=/local/workspace/best.onnx \
--hw-arch=hailo8l \
--calib-path=/local/workspace/calibration_images \
--classes=2 \
--performance
However, the process failed with the following error:
NMSConfigPostprocessException: The layer yolov8n/conv41 doesn't have one output layer
I have tried several solutions to resolve this issue, including:
- Using different export settings for the YOLOv8 model (e.g., adjusting the opset version during ONNX export).
- Checking the ONNX model structure to verify the output configuration of the
conv41
layer.
- Tweaking the NMS configuration as per the error message, but without success.
From my inspection, it seems that the conv41
layer in the ONNX model has an output configuration that is incompatible with the Hailo SDK’s requirements. As this has been a persistent roadblock, I would greatly appreciate any guidance or suggestions your team could provide.
Here are the details of my development environment:
- Operating System: Ubuntu 22.04, Docker version 24.0.7
- Hailo SDK Version: 4.19.0
- DFC Version: 3.29.0
- YOLOv8n Model: Ultralytics 8.3.32
Thank you very much for your support, and I look forward to your reply.
(hailo_virtualenv) hailo@pt:/local/workspace$ hailomz compile yolov8n
cal/work> --ckpt=/local/workspace/best.onnx \
--hw-arch=hailo8l \
--calib-path=/local/workspace/calibration_images \
--classes=2 \
--performance
Start run for network yolov8n …
Initializing the hailo8l 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.32)
[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/cv3.0/cv3.0.2/Conv /model.22/cv2.0/cv2.0.2/Conv /model.22/cv2.1/cv2.1.2/Conv /model.22/cv3.1/cv3.1.2/Conv /model.22/cv3.2/cv3.2.2/Conv /model.22/cv2.2/cv2.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: /local/workspace/yolov8n.har
Using generic alls script found in /local/workspace/hailo_model_zoo/hailo_model_zoo/cfg/alls/generic/yolov8n.alls because there is no specific hardware alls
Preparing calibration data…
[info] Loading model script commands to yolov8n from /local/workspace/hailo_model_zoo/hailo_model_zoo/cfg/alls/generic/yolov8n.alls
[info] Loading model script commands to yolov8n from string
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 91, in _ensure_optimized
optimize_model(
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py”, line 324, in optimize_model
optimize_full_precision_model(runner, calib_feed_callback, logger, model_script, resize, input_conversion, classes)
File “/local/workspace/hailo_model_zoo/hailo_model_zoo/core/main_utils.py”, line 310, in optimize_full_precision_model
runner.optimize_full_precision(calib_data=calib_feed_callback)
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 1996, in optimize_full_precision
self._optimize_full_precision(calib_data=calib_data, data_type=data_type)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py”, line 1999, in _optimize_full_precision
self._sdk_backend.optimize_full_precision(calib_data=calib_data, data_type=data_type)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/sdk_backend.py”, line 1497, in optimize_full_precision
model, params = self._apply_model_modification_commands(model, params, update_model_and_params)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/sdk_backend.py”, line 1388, in _apply_model_modification_commands
model, params = command.apply(model, params, hw_consts=self.hw_arch.consts)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/script_parser/nms_postprocess_command.py”, line 387, in apply
pp_creator = create_nms_postprocess(
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/tools/core_postprocess/nms_postprocess.py”, line 1767, in create_nms_postprocess
pp_creator.prepare_hn_and_weights(hw_consts, engine, dfl_on_nn_core=dfl_on_nn_core)
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/tools/core_postprocess/nms_postprocess.py”, line 1125, in prepare_hn_and_weights
super().prepare_hn_and_weights(
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/tools/core_postprocess/nms_postprocess.py”, line 1089, in prepare_hn_and_weights
self.add_postprocess_layer_to_hn()
File “/local/workspace/hailo_virtualenv/lib/python3.10/site-packages/hailo_sdk_client/tools/core_postprocess/nms_postprocess.py”, line 1040, in add_postprocess_layer_to_hn
raise NMSConfigPostprocessException(f"The layer {encoded_layer.name} doesn’t have one output layer")
hailo_sdk_client.tools.core_postprocess.nms_postprocess.NMSConfigPostprocessException: The layer yolov8n/conv41 doesn’t have one output layer