RKNN Toolkit Lite 的文件目录在 SDK/external/rknn-toolkit/rknn-toolkit-lite/rknn-toolkit-lite-v1.7.0.dev_0cfb22
或者直接使用 git 拉取代码:git clone
-b rv1126_rv1109/firefly
测试环境使用 RV1126 主机。文件系统是 Firefly Debian10。以下操作均 RV112 上执行。
Firefly Debian10 固件 RKNN Toolkit Lite 安装步骤:
一、 安装依赖 numpy / psutils / ruamel.yaml
如果没有装 pip3 ,请先用 sudo apt-get update && sudo apt-get install python3-pip 装下
pip3 install numpy==1.16.3
pip3 install psutil==5.6.2
pip3 install ruamel.yaml==0.15.81
二、 安装 opencv-python 。用 pip3 安装会一直失败,所以直接在网上下载包。
先装以下依赖, wget 用到的两个 deb 包已经放在 rknn-toolkit-lite-v1.7.0.dev_0cfb22/requires/ 目录下
sudo apt-get install multiarch-support
wget
sudo dpkg -i libjasper1_1.900.1-debian1-2.4+deb8u6_armhf.deb
wget
sudo dpkg -i libjasper-dev_1.900.1-debian1-2.4+deb8u6_armhf.deb
sudo apt-get install libhdf5-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libqtgui4
sudo apt-get install libqt4-test
pip3 install rknn-toolkit-lite-v1.7.0.dev_0cfb22/requires/opencv_python-4.0.1.24-cp37-cp37m-linux_armv7l.whl
三、安装 RKNN Toolkit Lite
使用以下命令安装RKNN Toolkit Lite
pip3 install rknn-toolkit-lite-v1.7.0.dev_0cfb22/packages/rknn_toolkit_lite-1.7.0.dev_0cfb22-cp37-cp37m-linux_armv7l.whl
四、跑 example
cd rknn-toolkit-lite-v1.7.0.dev_0cfb22/examples-lite/inference_with_lite
python3 test.py
结果输出如下:
结果输出如下:
root@firefly:/home/firefly/rknn-toolkit-lite-v1.7.0.dev_0cfb22/examples-lite/inference_with_lite# python3 test.py
--> list devices:
None devices connected.
done
--> query support target platform
Target platforms filled in RKNN model: ['RV1109']
Target platforms supported by this RKNN model: ['RK1109', 'RK1126', 'RV1109', 'RV1126']
done
--> Load RKNN model
done
--> Init runtime environment
done
--> get sdk version:
RKNN VERSION:
API: librknn_runtime version 1.6.0 (6523e57 build: 2021-01-15 15:56:31 base: 1126)
DRV: 6.4.3.5.293908
done
--> Running model
resnet18
-----TOP 5-----
[812]: 0.9993900656700134
[404]: 0.0004593880439642817
[657 833]: 2.9284517950145528e-05
[657 833]: 2.9284517950145528e-05
[895]: 1.850890475907363e-05
done
原作者:799959745