what I wan to implement is to allow yolov11 to predict object with oriented bounding box (x1, y1, x2, y2, angle), not just (x1, y1, x2, y2). The angle is additional.
So I change the yolo11n’s head structure (regression head), which conv’s output channel is +1.
But this model will fail during hailo optimize
process.
the error log:
File "/home/jbl/PythonEnv/py310/lib/python3.10/site-packages/hailo_model_optimization/acceleras/hailo_layers/hailo_postprocess.py", line 121, in call_core
return self.bbox_decoding_and_nms_call(
File "/home/jbl/PythonEnv/py310/lib/python3.10/site-packages/hailo_model_optimization/acceleras/hailo_layers/hailo_postprocess.py", line 158, in bbox_decoding_and_nms_call
decoded_bboxes, detection_score = self.yolov8_decoding_call(inputs, offsets=[0.5, 0.5])
File "/home/jbl/PythonEnv/py310/lib/python3.10/site-packages/hailo_model_optimization/acceleras/hailo_layers/hailo_postprocess.py", line 376, in yolov8_decoding_call
decoded_bboxes = tf.expand_dims(decoded_bboxes, axis=2)
ValueError: Exception encountered when calling HailoPostprocess.call().
Tried to convert 'input' to a tensor and failed. Error: None values not supported.
Arguments received by HailoPostprocess.call():
• inputs=['tf.Tensor(shape=(1, 80, 80, 65), dtype=float32)', 'tf.Tensor(shape=(1, 80, 80, 11), dtype=float32)', 'tf.Tensor(shape=(1, 40, 40, 65), dtype=float32)', 'tf.Tensor(shape=(1, 40, 40, 11), dtype=float32)', 'tf.Tensor(shape=(1, 20, 20, 65), dtype=float32)', 'tf.Tensor(shape=(1, 20, 20, 11), dtype=float32)']
• training=False
• kwargs={'encoding_tensors': 'None', 'cache_config': 'None'}
Calibration: 0%| | 0/20 [00:14<?, ?entries/s]
This is my yolov11.onnx
and calib_dataset.npy
in google_drive: yolo11n_opt_xywhr
# parser
# based on DFC-3.32.0
runner = ClientRunner(hw_arch="hailo8l")
end_notes = ['/head/cv2.0/cv2.0.2/Conv', '/head/cv3.0/cv3.0.4/Conv',
'/head/cv2.1/cv2.1.2/Conv', '/head/cv3.1/cv3.1.4/Conv',
'/head/cv2.2/cv2.2.2/Conv', '/head/cv3.2/cv3.2.4/Conv']
onnx_path = "./my_yolo11n_opt_regression_add_1.onnx"
har_path = "./parsered.fp32.har"
hn, npz = runner.translate_onnx_model(
onnx_path, "yolo11_xywhr",
start_node_names=['input'],
end_node_names=end_notes,
# net_input_shapes={'input': [1, 3, 640, 640]}
)
runner.save_har(har_path)
# optimize
alls = [
"quantization_param([conv54, conv65, conv80], force_range_out=[0.0, 1.0])\n",
"normalization1 = normalization([0.0, 0.0, 0.0], [255.0, 255.0, 255.0])\n",
"change_output_activation(conv54, sigmoid)\n",
"change_output_activation(conv65, sigmoid)\n",
"change_output_activation(conv80, sigmoid)\n",
"nms_postprocess('./my_yolo11n_nms_config.json', meta_arch=yolov8, engine=cpu)\n",
"allocator_param(width_splitter_defuse=disabled)\n"
]
calib_npy = "./calib_ds.int8.npy"
runner = ClientRunner(har=har_path)
runner.load_model_script("".join(alls))
runner.optimize(calib_npy)
runner.save_har(out_opt_file)
- the parsered network (one of the head of custom yolo11n):
Could you hailo R&D team guide me how to fix this error?
This issue may be the same with Unable to optimize custom yolov7 with additional output layer - General - Hailo Community