Hey @yurdakul21,
Welcome to the Hailo Community!
The error you’re encountering:
hailo_sdk_client.tools.core_postprocess.nms_postprocess.NMSConfigPostprocessException: The layer yolov8n/conv41 doesn't have one output layer
suggests that during the parsing or optimization process, the Hailo SDK is expecting the conv41
layer to have a single output, but it seems to be producing multiple outputs. Here’s how you can fix this issue:
1. Check the ONNX Model Output Layers
First, you need to confirm that the output layers of your YOLOv8 model are correct and match Hailo’s expectations.
-
Visualize the ONNX Model: Use Netron (https://netron.app/) to load and inspect the hailo-n178.onnx
model. Focus on the layers around conv41
to see how many outputs it produces.
-
The YOLOv8 model might have multiple output heads (for bounding boxes, objectness scores, and class probabilities). You need to identify the correct output layers that produce the final bounding box predictions and class probabilities.
2. Modify --end-node-names
in hailomz parse
When running the hailomz parse
command, you are currently specifying multiple end-node-names
. These need to correspond to the final layers of your model that produce the predictions, such as bounding boxes and classification scores. If conv41
is not one of these, you may need to adjust the layers you’re specifying.
Here’s the original command:
hailomz parse yolov8n --ckpt /home/usr/hailo-models/hailo-n178.onnx --hw-arch hailo8l --start-node-names 'images' --end-node-names '/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'
You may need to simplify and ensure that only the final output layers for bounding box regression and classification scores are specified. For example:
hailomz parse yolov8n --ckpt /home/usr/hailo-models/hailo-n178.onnx --hw-arch hailo8l --start-node-names 'images' --end-node-names 'output_boxes_layer' 'output_scores_layer'
Make sure to replace 'output_boxes_layer'
and 'output_scores_layer'
with the actual layer names from your ONNX model that correspond to the bounding box and class outputs.
3. Verify the Layers You Chose
To ensure the correct layers are used:
- Bounding Box Layer: Should output bounding box coordinates (e.g., [x, y, w, h]).
- Class Scores Layer: Should output objectness scores or class probabilities.
If you’re not sure which layers these are, refer to the ONNX model visualization in Netron.
4. Simplify the Outputs if Necessary
If you’re dealing with too many output layers in the parsing step, try focusing on just the necessary outputs (bounding boxes and class scores). Specifying too many outputs can confuse the Hailo SDK and cause errors during the NMS step.
Regards,
Omri