Hailo Code Example Error

Hello.I have raspberry pi 5 with hailo 8l.I have converted my yolov8n.pt to yolov8n.hef.I want to detect objects using source code from github but I have error message about source code from github.How can I solve that?

Code:
resized_img = cv2.resize(frame, (INPUT_RES_H, INPUT_RES_W), interpolation = cv2.INTER_AREA)
with InferVStreams(network_group, input_vstreams_params, output_vstreams_params) as infer_pipeline:
input_data = {input_vstream_info.name: np.expand_dims(np.asarray(resized_img), axis=0).astype(np.float32)}
with network_group.activate(network_group_params):
infer_results = infer_pipeline.infer(input_data)

        # create dictionary that returns layer name from tensor shape (required for postprocessing)
        layer_from_shape: dict = {infer_results[key].shape:key for key in infer_results.keys()}

Error Message:

Exception has occurred: AttributeError
‘list’ object has no attribute ‘shape’
File “/home/halil/hailo_platform_venv/son.py”, line 67, in
layer_from_shape: dict = {infer_results[key].shape:key for key in infer_results.keys()}
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/halil/hailo_platform_venv/son.py”, line 67, in
layer_from_shape: dict = {infer_results[key].shape:key for key in infer_results.keys()}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘list’ object has no attribute ‘shape’

Hey @faikkom66,

To help you better, I have a few questions:

  1. Are you using this example from the Hailo GitHub repository? Hailo-Application-Code-Examples/runtime/python/streaming/yolox_stream_inference.py at c0e80f7f5d5dd1de56cf241e4e2af64a8c20435c · hailo-ai/Hailo-Application-Code-Examples · GitHub
    a. If yes, the error you’re experiencing might be because you’re running YOLOv8 instead of YOLOX. The code at that link is specifically designed for YOLOX.
    b. If you’re not using this example, could you please let me know which one you are using? This will help me recreate the error and provide more accurate assistance.

Please note:

  • These examples haven’t been optimized for Raspberry Pi yet, but optimization is planned for the near future.

Regards