我今天也遇到了这个问题,wiki提供的rknn example已经不能用了,我用rockchip最新的1.2版本编译后可以使用
1,安装编译所需依赖
sudo apt install git cmake build-essential
2,下载rockchip最新的rknpu2代码
git clone https://github.com/rockchip-linux/rknpu2
3,进入代码目录,创建build目录
cd rknpu2/examples/rknn_ssd_demo
mkdir build && cd build
4,修改CMakeLists.txt,防止编译出错
vim …/CMakeLists.txt
将23行的armhf改为aarch64
5,编译
cmake -DCMAKE_SYSTEM_NAME=Linux -DTARGET_SOC=rk356x …
make -j3
6,将model目录复制到build目录
cp -r …/model/ .
7,运行
./rknn_ssd_demo ./model/RK356X/ssd_inception_v2.rknn ./model/road.bmp
可以得到如下输出:
Loading model …
rknn_init …
model input num: 1, output num: 2
input tensors:
index=0, name=Preprocessor/sub:0, n_dims=4, dims=[1, 300, 300, 3], n_elems=270000, size=270000, fmt=NHWC, type=UINT8, qnt_type=AFFINE, zp=0, scale=0.007812
output tensors:
index=0, name=concat:0, n_dims=4, dims=[1, 1917, 1, 4], n_elems=7668, size=30672, fmt=NHWC, type=FP32, qnt_type=AFFINE, zp=53, scale=0.089455
index=1, name=concat_1:0, n_dims=4, dims=[1, 1917, 91, 1], n_elems=174447, size=697788, fmt=NHWC, type=FP32, qnt_type=AFFINE, zp=53, scale=0.143593
rknn_run
loadLabelName
ssd - loadLabelName ./model/coco_labels_list.txt
loadBoxPriors
person @ (13 125 59 212) 0.984696
person @ (110 119 152 197) 0.969119
bicycle @ (171 165 278 234) 0.969119
person @ (206 113 256 216) 0.964519
car @ (146 133 216 170) 0.959264
person @ (49 133 58 156) 0.606060
person @ (83 134 92 158) 0.606060
person @ (96 135 106 162) 0.464163