rockchip-linux / rknn-toolkit

BSD 3-Clause "New" or "Revised" License
771 stars 175 forks source link

Init runtime environment failed : OSError: /usr/lib/librknnrt.so: invalid ELF header #414

Closed michelle123-creator closed 6 months ago

michelle123-creator commented 7 months ago

I have run the rknn toolkit lite2 on orange pi 5 using ssh , the librknnrt.so download from https://github.com/rockchip-linux/rknpu2/tree/master/runtime/RK3588/Linux/librknn_api/aarch64 Run Command: python3 yolo_map_test_rknn.py --model yolov8 --model_path ./yolov8s_RK3588_fp.rknn --target RK3588 --img_folder ../test_data --img_show /home/michelle/rknn_model_zoo/models/CV/object_detection/yolo/RKNN_python_demo/yolo_map_test_rknn.py

Output: None anchors file determine, free anchors mode

Continue? [Y/N] Y or N:Y

--> Load RKNN Model done --> Init runtime environment E Catch exception when init runtime! E Traceback (most recent call last): File "/home/michelle/.local/lib/python3.10/site-packages/rknnlite/api/rknn_lite.py", line 140, in init_runtime self.rknn_runtime = RKNNRuntime(root_dir=self.root_dir, target=target, device_id=device_id, File "rknnlite/api/rknn_runtime.py", line 319, in rknnlite.api.rknn_runtime.RKNNRuntime.init File "rknnlite/api/rknn_runtime.py", line 562, in rknnlite.api.rknn_runtime.RKNNRuntime._load_library File "/usr/local/opt/python-3.10.2/lib/python3.10/ctypes/init.py", line 374, in init self._handle = _dlopen(self._name, mode) OSError: /usr/lib/librknnrt.so: invalid ELF header

E Runtime environment is not inited, please call init_runtime to init it first! None Init runtime environment failed

eRaul commented 7 months ago

This problem may be caused by the incomplete download of librknnrt.so. You can use the md5sum /usr/lib/librknnrt.so command to calculate the md5 value and provide the result.

trohit920 commented 6 months ago

@eRaul @michelle123-creator I am also facing the same issue. Please check below requested output

debian@bookworm:~$ md5sum /usr/lib/librknnrt.so
c9f2cca5cc51f2475149f39418de8b78  /usr/lib/librknnrt.so
eRaul commented 6 months ago

@eRaul @michelle123-creator I am also facing the same issue. Please check below requested output

debian@bookworm:~$ md5sum /usr/lib/librknnrt.so
c9f2cca5cc51f2475149f39418de8b78  /usr/lib/librknnrt.so

Which target platform are you using? What version of librknnrt.so is used?