Hi Hailo Community,
I’m trying to optimize a YOLOv8m model for Hailo-8L using Hailo Model Zoo (version: 2.17 on Ubuntu 22.04 with 19GB RAM (CPU fallback, no GPU). The goal is to apply sigmoid activations to the 6 Conv layers in the Detect head (model.22) for better post-processing, plus normalization, calibration, finetuning, NMS, and resource params.
Setup:
-
Model: custom best.onnx via --ckpt.
-
Calibration: ~1000 images in ./calib_images.
-
Command: hailomz optimize --hw-arch hailo8l --har ./yolov8m.har yolov8m --calib-path ./calib_images --verbose
My .alls Script (at /hailo_model_zoo/hailo_model_zoo/cfg/alls/hailo8l/base/yolov8m.alls):
text
normalization1 = normalization([0.0, 0.0, 0.0], [255.0, 255.0, 255.0])
model_optimization_config(calibration, batch_size=2)
scope model.22
change_output_activation(cv2.0/cv2.0.2/Conv, sigmoid)
change_output_activation(cv3.0/cv3.0.2/Conv, sigmoid)
change_output_activation(cv2.1/cv2.1.2/Conv, sigmoid)
change_output_activation(cv3.1/cv3.1.2/Conv, sigmoid)
change_output_activation(cv2.2/cv2.2.2/Conv, sigmoid)
change_output_activation(cv3.2/cv3.2.2/Conv, sigmoid)
end_scope
post_quantization_optimization(finetune, policy=enabled, learning_rate=0.000025)
nms_postprocess("yolov8m_nms_config.json", meta_arch=yolov8, engine=cpu)
resources_param(max_apu_utilization=1.0, max_compute_16bit_utilization=1.0, max_compute_utilization=1.0, max_control_utilization=1.0, max_input_aligner_utilization=1.0, max_memory_utilization=0.85, max_utilization=0.0)
-
NMS config exists with standard COCO params (score_thresh=0.25, iou_thresh=0.45, num_classes=80).
-
Layer paths confirmed via hailo parser yolov8m.onnx --print-graph | grep -E ‘cv[2-3]\.[0-9]+\.2/Conv’ (matches 6 end nodes from parse logs).
Error: Fails immediately on script loading:
text
[info] Loading model script commands to yolov8m from .../yolov8m.alls
Traceback ... pyparsing.ParseException: Expected end of text, found 's' (at char 116), (line:3, col:1)
BackendScriptParserException: Parsing failed at:
>!<scopemodel.22
It treats line 3 as “scopemodel.22” (no space), despite editing with nano/cat and verifying via cat -n -A (shows space: “3 scope model.22$”).
Troubleshooting Tried:
-
Recreated file multiple times with cat > … << ‘EOF’ and nano (checked for ^M/CRLF, tabs vs. spaces—using 4 spaces for indent).
-
Minimal script test: Just normalization + one activation in scope—same error.
-
Inline --model-script flag: Fails similarly.
-
Variations: scope(model.22), scope /model.22, quoted paths (“/cv2.0/cv2.0.2/Conv”), no scope (direct full path)—all hit scope/add_scope exceptions or pyparsing fails.
-
Updated Model Zoo (hailomz update), verified env activation.
-
Parse works fine without .alls: hailomz parse … detects YOLOv8 structure correctly.
Any ideas on why the space is ignored or ALLS grammar quirks for scope in YOLOv8? Happy to share full logs/file if needed. Thanks!
End Post