Hi, I want to use hailo8L on Pi5, so I install hailort4.18 follow this guid:
And my inference code is like below:
# General imports used throughout the tutorial
from multiprocessing import Process
import numpy as np
from hailo_platform import (
HEF,
ConfigureParams,
FormatType,
HailoSchedulingAlgorithm,
HailoStreamInterface,
InferVStreams,
InputVStreamParams,
InputVStreams,
OutputVStreamParams,
OutputVStreams,
VDevice,
)
# from hailo_sdk_client import ClientRunner, InferenceContext
# Setting VDevice params to disable the HailoRT service feature
params = VDevice.create_params()
params.scheduling_algorithm = HailoSchedulingAlgorithm.NONE
# The target can be used as a context manager ("with" statement) to ensure it's released on time.
# Here it's avoided for the sake of simplicity
target = VDevice(params=params)
# Loading compiled HEFs to device:
model_name = "mbf"
hef_path = f"{model_name}.hef"
hef = HEF(hef_path)
# Get the "network groups" (connectivity groups, aka. "different networks") information from the .hef
configure_params = ConfigureParams.create_from_hef(hef=hef, interface=HailoStreamInterface.PCIe)
network_groups = target.configure(hef, configure_params)
network_group = network_groups[0]
network_group_params = network_group.create_params()
# Create input and output virtual streams params
# Quantized argument signifies whether or not the incoming data is already quantized.
# Data is quantized by HailoRT if and only if quantized == False .
input_vstreams_params = InputVStreamParams.make(network_group, quantized=False, format_type=FormatType.FLOAT32)
output_vstreams_params = OutputVStreamParams.make(network_group, quantized=True, format_type=FormatType.UINT8)
# Define dataset params
input_vstream_info = hef.get_input_vstream_infos()[0]
output_vstream_info = hef.get_output_vstream_infos()[0]
image_height, image_width, channels = input_vstream_info.shape
num_of_images = 10
low, high = 2, 20
# Generate random dataset
dataset = np.random.randint(low, high, (num_of_images, image_height, image_width, channels)).astype(np.float32)
input_data = {input_vstream_info.name: dataset}
with InferVStreams(network_group, input_vstreams_params, output_vstreams_params) as infer_pipeline:
with network_group.activate(network_group_params):
infer_results = infer_pipeline.infer(input_data)
# The result output tensor is infer_results[output_vstream_info.name]
print(f"Stream output shape is {infer_results[output_vstream_info.name].shape}")
And I am sure hailo driver is installed:
(hailo_env) ain@raspberrypi5:~ $ hailortcli fw-control identify
Executing on device: 0000:01:00.0
Identifying board
Control Protocol Version: 2
Firmware Version: 4.18.0 (release,app,extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8L
Serial Number: HLDDLBB243202208
Part Number: HM21LB1C2LAE
Product Name: HAILO-8L AI ACC M.2 B+M KEY MODULE EXT TMP
And I get error like bellow:
(hailo_env) ain@raspberrypi5:~/face_hailo $ python run.py
[HailoRT] [error] CHECK failed - max_desc_page_size given 16384 is bigger than hw max desc page size 4096
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
[HailoRT] [error] CHECK_SUCCESS failed with status=HAILO_INTERNAL_FAILURE(8)
Traceback (most recent call last):
File "/home/ain/hailo_env/lib/python3.11/site-packages/hailo_platform/pyhailort/pyhailort.py", line 3503, in configure
configured_ngs_handles = self._vdevice.configure(hef._hef, configure_params_by_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hailo_platform.pyhailort._pyhailort.HailoRTStatusException: 8
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/ain/face_hailo/run.py", line 37, in <module>
network_groups = target.configure(hef, configure_params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ain/hailo_env/lib/python3.11/site-packages/hailo_platform/pyhailort/pyhailort.py", line 3502, in configure
with ExceptionWrapper():
File "/home/ain/hailo_env/lib/python3.11/site-packages/hailo_platform/pyhailort/pyhailort.py", line 110, in __exit__
self._raise_indicative_status_exception(value)
File "/home/ain/hailo_env/lib/python3.11/site-packages/hailo_platform/pyhailort/pyhailort.py", line 155, in _raise_indicative_status_exception
raise self.create_exception_from_status(error_code) from libhailort_exception
hailo_platform.pyhailort.pyhailort.HailoRTException: libhailort failed with error: 8 (HAILO_INTERNAL_FAILURE)