RV1126 安装 RKNN Toolkit Lite 的方法
本帖最后由 板蓝根 于 2021-6-25 10:31 编辑RKNN Toolkit Lite 的文件目录在 SDK/external/rknn-toolkit/rknn-toolkit-lite/rknn-toolkit-lite-v1.7.0.dev_0cfb22
或者直接使用 git 拉取代码:git clone https://gitlab.com/firefly-linux/external/rknn-toolkit.git -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 http://security.debian.org/debian-security/pool/updates/main/j/jasper/libjasper1_1.900.1-debian1-2.4+deb8u6_armhf.deb
sudo dpkg -i libjasper1_1.900.1-debian1-2.4+deb8u6_armhf.deb
wget http://security.debian.org/debian-security/pool/updates/main/j/jasper/libjasper-dev_1.900.1-debian1-2.4+deb8u6_armhf.deb
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-----
: 0.9993900656700134
: 0.0004593880439642817
: 2.9284517950145528e-05
: 2.9284517950145528e-05
: 1.850890475907363e-05
done
点赞! 为啥我的RV1126板子 只能通过172.16网段与主机连接,不能直接上网,安装python环境很麻烦啊 3d_yl 发表于 2021-7-6 10:21
为啥我的RV1126板子 只能通过172.16网段与主机连接,不能直接上网,安装python环境很麻烦啊
你确定你刷的是 debian10 固件? 板蓝根 发表于 2021-6-25 10:32
点赞!
你买的板子是型号是 CORE-1126-JD4 吗? 799959745 发表于 2021-7-15 10:48
你买的板子是型号是 CORE-1126-JD4 吗?
Debian10 适配的是 CORE-1126-JD4 / CORE-1109-JD4 本帖最后由 liu12111 于 2021-11-16 22:46 编辑
板子为core-1126-jd4。镜像为官方2021年4月19号的build镜像搭配debian10的三个文件。
按照上面方法装的环境,跑example。报错如下:firefly@firefly:/opt/rknn-toolkit-lite/rknn-toolkit-lite-v1.7.0.dev_0cfb22/examp
les-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
[ 1] Failed to open device: No such file or directory, Try again...
[ 2] Failed to open device: No such file or directory, Try again...
[ 3] Failed to open device: No such file or directory, Try again...
[ 4] Failed to open device: No such file or directory, Try again...
[ 5] _OpenDevice(1086): FATAL: Failed to open device, errno=No such file or directory.
跑 rknn 必须使用 sudo 管理员权限 请问,rv1126 对yolov3进行模型预测,能实现视频实时效果吗?最高能到多少帧。 东逝之水 发表于 2022-4-10 21:27
请问,rv1126 对yolov3进行模型预测,能实现视频实时效果吗?最高能到多少帧。
没有试过