rk3568问题
gxydbc opened this issue · 6 comments
如果要将这个代码部署在rk3568上,需要做哪些修改呢 谢谢!
在运行./build-linux_RK3588.sh时,结果如下
root@iTOP-RK3568:/home/topeet/rknn-cpp-Multithreading-main$ ./build-linux_RK3588.sh
-- Configuring done
-- Generating done
-- Build files have been written to: /home/topeet/rknn-cpp-Multithreading-main/build/build_linux_aarch64
[100%] Built target rknn_yolov5_demo
[100%] Built target rknn_yolov5_demo
Install the project...
-- Install configuration: ""
-- Up-to-date: /home/topeet/rknn-cpp-Multithreading-main/install/rknn_yolov5_demo_Linux/./rknn_yolov5_demo
-- Up-to-date: /home/topeet/rknn-cpp-Multithreading-main/install/rknn_yolov5_demo_Linux/lib/librknnrt.so
-- Up-to-date: /home/topeet/rknn-cpp-Multithreading-main/install/rknn_yolov5_demo_Linux/lib/librga.so
-- Up-to-date: /home/topeet/rknn-cpp-Multithreading-main/install/rknn_yolov5_demo_Linux/.//model
-- Up-to-date: /home/topeet/rknn-cpp-Multithreading-main/install/rknn_yolov5_demo_Linux/.//model/RK3588
-- Up-to-date: /home/topeet/rknn-cpp-Multithreading-main/install/rknn_yolov5_demo_Linux/.//model/RK3588/yolov5s.rknn
-- Up-to-date: /home/topeet/rknn-cpp-Multithreading-main/install/rknn_yolov5_demo_Linux/.//model/RK3588/yolov5s-640-640.rknn
-- Up-to-date: /home/topeet/rknn-cpp-Multithreading-main/install/rknn_yolov5_demo_Linux/.//model/coco_80_labels_list.txt
/home/topeet/rknn-cpp-Multithreading-main
模型名称: ./model/RK3588/yolov5s.rknn
线程数: 6
Loading mode...
E RKNN: [07:34:24.135] failed to check rknpu hardware version: 0
E RKNN: [07:34:24.135] This rknn model is for RK3588, but current platform is RK3566/RK3568
E RKNN: [07:34:24.143] rknn_init, load model failed!
rknn_init error ret=-6
如果要将这个代码部署在rk3568上,需要做哪些修改呢 谢谢!
快速部署的话可以尝试:
替换include下的动态链接库librknn_api.so librknnrt.so
替换include下的头文件rknn_api.h
将model/RK3588的模型换为https://github.com/rockchip-linux/rknpu2/tree/v1.5.0/examples/rknn_yolov5_demo/model/RK3566_RK3568 下的模型
注释掉include/rknnPool.hpp的59 - 71行
注释掉build-linux_RK3588.sh的28行, 并取消26行的注释
将include/rknnPool.hpp的167 - 186行替换为
if (img_width != width || img_height != height)
cv::resize(img, img, cv::Size(640, 640));
inputs[0].buf = (void *)img.data;
然后到根目录下运行build-linux_RK3588.sh进行编译测试
需要注意的是,rk3568的npu算力并不高(rk3588的1/6),多线程的加速效果可能不明显(在rk3566上测试提升大约50% ?)
可能的改进提升方案:
-
采用 rknn_model_zoo下的优化模型
-
更新rknn的api版本为1.5.2,本项目截止目前使用的api仍是1.5.0版本(校内作业太多暂无力更新项目)
-
使用mpp进行解/编码,使用rga进行图片放缩,具体也可以参考rknpu2主线下的视频demo
-
尝试跳帧推理(第一帧进行推理绘制,第二帧使用第一帧的推理结果进行预测框体绘制,第三帧进行推理绘制······以此类推),此方法能较明显地提高帧率,但在高速场景下的表现可能非常糟糕
好的,非常感谢!
如果要将这个代码部署在rk3568上,需要做哪些修改呢 谢谢!
快速部署的话可以尝试:
替换include下的动态链接库librknn_api.so librknnrt.so
替换include下的头文件rknn_api.h
将model/RK3588的模型换为https://github.com/rockchip-linux/rknpu2/tree/v1.5.0/examples/rknn_yolov5_demo/model/RK3566_RK3568 下的模型
注释掉include/rknnPool.hpp的59 - 71行
注释掉build-linux_RK3588.sh的28行, 并取消26行的注释
将include/rknnPool.hpp的167 - 186行替换为
if (img_width != width || img_height != height) cv::resize(img, img, cv::Size(640, 640)); inputs[0].buf = (void *)img.data;
然后到根目录下运行build-linux_RK3588.sh进行编译测试
将include/rknnPool.hpp的167 - 186行替换为,为什么rknnPool.hpp并没有这么多行
如果要将这个代码部署在rk3568上,需要做哪些修改呢 谢谢!
快速部署的话可以尝试:
替换include下的动态链接库librknn_api.so librknnrt.so
替换include下的头文件rknn_api.h
将model/RK3588的模型换为https://github.com/rockchip-linux/rknpu2/tree/v1.5.0/examples/rknn_yolov5_demo/model/RK3566_RK3568 下的模型
注释掉include/rknnPool.hpp的59 - 71行
注释掉build-linux_RK3588.sh的28行, 并取消26行的注释
将include/rknnPool.hpp的167 - 186行替换为if (img_width != width || img_height != height) cv::resize(img, img, cv::Size(640, 640)); inputs[0].buf = (void *)img.data;
然后到根目录下运行build-linux_RK3588.sh进行编译测试
将include/rknnPool.hpp的167 - 186行替换为,为什么rknnPool.hpp并没有这么多行
见于此分支https://github.com/leafqycc/rknn-cpp-Multithreading/tree/1.5.0