I’m trying to compile a YOLOv8m model to a .hef
file using Hailo-8L, starting from an ONNX model.
Environment Setup:
- Main working directory:
/home/hailo/shared/
- Command used:
bash
CopyEdit
hailomz compile yolov8m \
--har /home/hailo/shared/yolov8m.har \
--calib-path /home/hailo/shared/datasets/images/train \
--hw-arch hailo8l
YAML File:
/home/hailo/shared/hailo_model_zoo/hailo_model_zoo/cfg/networks/yolov8m.yaml
yaml
CopyEdit
base:
- base/yolov8.yaml
postprocessing:
device_pre_post_layers:
nms: true
hpp: true
network:
network_name: yolov8m
paths:
network_path:
- /home/hailo/shared/yolov8m.har
alls_script: cfg/alls/generic/yolov8m.alls
hef_name: yolov8m.hef
output_dir: compiled_model_yolov8m
info:
task: object detection
input_shape: 640x640x3
output_shape: 80x5x100
operations: 78.93G
parameters: 25.9M
framework: pytorch
training_data: coco train2017
validation_data: coco val2017
eval_metric: mAP
full_precision_result: 49.9
source: https://github.com/ultralytics/ultralytics
license_url: https://github.com/ultralytics/ultralytics/blob/main/LICENSE
license_name: AGPL-3.0
Model Script (.alls):
/home/hailo/shared/hailo_model_zoo/hailo_model_zoo/cfg/alls/generic/yolov8m.alls
python
CopyEdit
normalization1 = normalization([0.0, 0.0, 0.0], [255.0, 255.0, 255.0])
model_optimization_config(calibration, batch_size=2)
change_output_activation(conv58, sigmoid)
change_output_activation(conv71, sigmoid)
change_output_activation(conv83, sigmoid)
post_quantization_optimization(finetune, policy=enabled, learning_rate=0.000025)
nms_postprocess("/home/hailo/shared/hailo_model_zoo/hailo_model_zoo/cfg/postprocess_config/yolov8m_nms_config.json", meta_arch=yolov8, engine=cpu)
resources_param(max_apu_utilization=0.9, max_compute_16bit_utilization=0.9, max_compute_utilization=0.9, max_control_utilization=0.9, max_input_aligner_utilization=0.9, max_memory_utilization=0.85, max_utilization=0.0)
Postprocess Config (NMS):
/home/hailo/shared/hailo_model_zoo/hailo_model_zoo/cfg/postprocess_config/yolov8m_nms_config.json
json
CopyEdit
{
"nms_scores_th": 0.2,
"nms_iou_th": 0.7,
"image_dims": [640, 640],
"max_proposals_per_class": 100,
"classes": 80,
"regression_length": 16,
"background_removal": false,
"background_removal_index": 0,
"bbox_decoders": [
{
"name": "bbox_decoder57",
"stride": 8,
"reg_layer": "conv57",
"cls_layer": "conv58"
},
{
"name": "bbox_decoder70",
"stride": 16,
"reg_layer": "conv70",
"cls_layer": "conv71"
},
{
"name": "bbox_decoder82",
"stride": 32,
"reg_layer": "conv82",
"cls_layer": "conv83"
}
]
}
Output & Error:
text
CopyEdit
[info] Model Optimization Algorithm Quantization-Aware Fine-Tuning is done (completion time is 00:05:16.93)
[info] Layer Noise Analysis skipped
[info] Model Optimization is done
[info] Saved HAR to: /home/hailo/shared/hailo_model_zoo/yolov8m.har
[info] Loading model script commands to yolov8m from /home/hailo/shared/hailo_model_zoo/hailo_model_zoo/cfg/alls/generic/yolov8m.alls
[info] ParsedPerformanceParam command, setting optimization_level(max=2)
[error] Failed to produce compiled graph
[error] TypeError: expected str, bytes or os.PathLike object, not NoneType
What I Tried:
- Verified
.har
,.alls
, and.json
paths are correct. - Corrected
post_quantization_optimization
to usecalibration
instead of invalidfinetune
. - Ensured normalization values and NMS config are set properly.
Request:
Can someone confirm what typically causes the TypeError: expected str, bytes or os.PathLike object, not NoneType
at the graph compilation step in this context? Is there a missing required path, output name, or value expected by the compiler?
Thanks in advance for your support.