I have update HailoRT and Tapps, but can not run

I have update HailoRT and Tapps to the lastest version, but it can not run any example.
I installed hailo example, and I run object detection:

(hailo_platform_venv) ain@ain:~/object_detection $ ./object_detection.py -n ./yolov8s.hef -i output_image0.jpg 
Traceback (most recent call last):
  File "/home/ain/object_detection/./object_detection.py", line 18, in <module>
    from utils import HailoAsyncInference, load_input_images, validate_images, divide_list_to_batches
ImportError: cannot import name 'HailoAsyncInference' from 'utils' (/home/ain/hailo_platform_venv/lib/python3.11/site-packages/utils/__init__.py)

When I use video stream

(hailo_platform_venv) ain@ain:~/streaming $ ./yolox_stream_inference.py 
[HailoRT] [warning] HEF was compiled for Hailo8L device, while the device itself is Hailo8. This will result in lower performance.
[HailoRT] [warning] HEF was compiled for Hailo8L device, while the device itself is Hailo8. This will result in lower performance.
Traceback (most recent call last):
  File "/home/ain/streaming/./yolox_stream_inference.py", line 67, in <module>
    layer_from_shape: dict = {infer_results[key].shape:key for key in infer_results.keys()}            
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ain/streaming/./yolox_stream_inference.py", line 67, in <dictcomp>
    layer_from_shape: dict = {infer_results[key].shape:key for key in infer_results.keys()}            
                              ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'shape'

How to use it?

Hello @jiahao.li,

It appears you’re encountering an issue importing HailoAsyncInference from the Utils module. Let’s troubleshoot this together.

Could you please verify that the Utils file is located in the correct directory? The expected path for this file should be:

Hailo-Application-Code-Examples/runtime/python/utils.py

It seems utils.py exist the right floder:

(hailo_platform_venv) ain@ain:~/Hailo-Application-Code-Examples/runtime/python $ ls
depth_estimation        hailo_onnxruntime      lane_detection    pose_estimation  streaming         utils.py
detection_with_tracker  instance_segmentation  object_detection  README.md        super_resolution

Ok , Lets do this :


  1. Open a command prompt or terminal on your computer.
  2. Start the Python 3 interpreter by typing python3 (or python if that’s the configuration on your system) and pressing Enter.
  3. Once you’re in the Python interactive shell, type the following import statement and press Enter:
from utils import HailoASyncInference

If everything is set up correctly and the module is installed, this command will import the HailoASyncInference class from the utils module.


I have installed the old version, the old version can install with one command but the latest can not, please make it better.

I see, that makes sense now. You can’t run this because PyHailoRT version 4.17 isn’t installed. We’ve already prepared a one-command installation, but we’re currently waiting for the Raspberry Pi release.

In the meantime, please check out my guide here: Upgrade HailoRT to 4.18 on RPi. If you have any further questions, feel free to ask!

  • Note : if you are going to use Python API only and not the hailo_rpi5_examples ( gstreamer ) you don’t need to install tappas !