Dear all,
I am encountering an issue while optimizing a YOLOv8n model for the Hailo-8L using the Hailo AI Software Suite (version 2025-07:1) in a Docker container (host: d4002ee7b6ff, workspace: /workspace). Below are the details of the issue:
Problem Description: When running the optimization command:
hailomz optimize --hw-arch hailo8l --calib-path /workspace/processed_images/calib_set.npz --resize 640 640 --classes 2 --har yolov8n.har --model-script yolov8n.all yolov8n
I receive the following error:
ValueError: {'calibset_size': 128.0} is not a valid MOConfigCommand
This error occurs after updating the model script (yolov8n.all) to include calibset_size=128. Previously, I encountered a calibset_size=0 error when using checker_cfg in the model script.
Current Setup:
-
Model Script (/workspace/yolov8n.all):
my_norm = normalization([0.0, 0.0, 0.0], [255.0, 255.0, 255.0]) custom_resize_input = resize(resize_shapes=[640,640]) model_optimization_config(calibset_size=128, dataset_size=128, batch_size=8, policy=enabled) -
Calibration Data:
-
File: /workspace/processed_images/calib_set.npz
-
Content: 128 images, shape (128, 640, 640, 3), dtype uint8, values 0–255
-
Verified with:
python3 -c "import numpy as np; d = np.load('/workspace/processed_images/calib_set.npz'); print(d.files); arr = d['calib_set']; print(arr.shape, arr.dtype, arr.min(), arr.max())"Output: [‘calib_set’] (128, 640, 640, 3) uint8 0 255
-
Size: 151 MB
-
-
Input Model: yolov8n.har (converted from ONNX with opset=11)
-
Environment: CPU-based, no GPU available (logs indicate fallback to CPU).
Steps Taken:
-
Updated yolov8n.all to remove checker_cfg and add calibset_size=128, based on community suggestions.
-
Confirmed that the .npz file is valid but learned that .npy is preferred for --calib-path.
-
Attempted to create /workspace/processed_images/calib_set.npy using a Python script:
import os import cv2 import numpy as np img_dir = "/workspace/calib_images" out_file = "/workspace/processed_images/calib_set.npy" images = [] for fname in sorted(os.listdir(img_dir))[:128]: if fname.lower().endswith((".jpg", ".jpeg", ".png")): img_path = os.path.join(img_dir, fname) img = cv2.imread(img_path) if img is None: print(f"❌ Не удалось загрузить: {fname}") continue img = cv2.resize(img, (640, 640)) img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) images.append(img) print(f"✅ Обработано: {fname}") images = np.array(images, dtype=np.uint8) np.save(out_file, images) print(f"💾 Сохранено {images.shape} в {out_file}, dtype: {images.dtype}") -
Cleared SDK cache using rm -rf /tmp/hailo* /local/workspace/hailo_model_zoo/.cache.
Additional Information:
-
I noticed from the Hailo Community that calibset_size and dataset_size may not be supported in model_optimization_config. I also tried:
my_norm = normalization([0.0, 0.0, 0.0], [255.0, 255.0, 255.0]) custom_resize_input = resize(resize_shapes=[640,640]) model_optimization_config(batch_size=8, policy=enabled) model_optimization_flavor(optimization_level=2, compression_level=0)but I have not yet tested this configuration due to the .npz vs .npy issue.
-
The community suggests using a directory of images for --calib-path as an alternative, which I plan to try next.
Questions:
- Is calibset_size supported in model_optimization_config for the 2025-07:1 SDK? If not, what is the correct syntax for yolov8n.all to ensure proper calibration with 128 images?
- Does the SDK strictly require a .npy file for --calib-path, or can .npz be used with a specific configuration?
- Are there additional parameters or environment settings (e.g., HAILO_LOG_LEVEL=debug) that could help diagnose why the SDK fails to recognize the calibration data?
- Could you confirm if the opset=11 for the ONNX model is appropriate for YOLOv8n on Hailo-8L?
- Could you provide the correct commands and parameters for MOConfigCommand in the yolov8n.all file to avoid the ValueError: {‘calibset_size’: 128.0} is not a valid MOConfigCommand error?
Request: Please provide guidance on the correct yolov8n.all syntax and whether .npy is mandatory. Additionally, any recommendations to avoid the ValueError: {‘calibset_size’: 128.0} is not a valid MOConfigCommand and ensure successful optimization and compilation to HEF would be greatly appreciated.
Thank you for your support!
Best regards, Bogdan