Toybrick

标题: the differences between rknn v1.3 vs lower rknn version [打印本页]

作者: nvnn    时间: 2020-2-28 10:19
标题: the differences between rknn v1.3 vs lower rknn version
Hi,
I am trying to run a rknn model in lower version of rknn.
In rknn version 1.3.0, it works perfectly. Output is a array with shape = (1,320,320,3)
In rknn version 1.2.0 or 0.9.9: output shape = (1, 307200).

I tried to reshape the output with shape = (1, 307200) to has same output of rknnv1.3.0. But the result is totally different.
  1. out_boxes = rknn.inference(inputs=[image])
  2. out_boxes = out_boxes[0].reshape(320, 320, 3)
复制代码

Please give me advices, how should I reshape my rknn 1.2 outpur? Thanks


作者: jefferyzhang    时间: 2020-2-28 10:25
Version 1.3.0 fixes many issues and add pytorch & mxnet support .
In the older version, you can reshape output by yourself, and be careful about NHWC or NCHW.
Maybe you can try reshape with (3, 320, 320) and check again.
作者: nvnn    时间: 2020-2-28 11:47
jefferyzhang 发表于 2020-2-28 10:25
Version 1.3.0 fixes many issues and add pytorch & mxnet support .
In the older version, you can resh ...

Thanks. I tried again. reshape works in rknn v1.20, but not 0.9.9. How should I reshape in version 0.9.9? Thanks again!
作者: jefferyzhang    时间: 2020-2-28 12:20
nvnn 发表于 2020-2-28 11:47
Thanks. I tried again. reshape works in rknn v1.20, but not 0.9.9. How should I reshape in version ...

We don't suggest use old version.
I found there was something changed in output shape in version 1.1.0, I'm no sure about if need reshape in 0.9.9 which is too old.
作者: nvnn    时间: 2020-2-28 12:25
jefferyzhang 发表于 2020-2-28 12:20
We don't suggest use old version.
I found there was something changed in output shape in version 1 ...

Thanks for your suggestion. By the way, What if I want to use rknn v1.3 for c++ api? Should I rebuild the rootfs.img? Or just get rknn-appi.so (for rknn v1.3.0) and link it into my program?
作者: jefferyzhang    时间: 2020-2-28 14:24
Update system by using apt upgrade/ dnf update, which will update librknn-api.so and npu-driver, both need 1.3.x.

作者: nvnn    时间: 2020-2-28 16:25
jefferyzhang 发表于 2020-2-28 14:24
Update system by using apt upgrade/ dnf update, which will update librknn-api.so and npu-driver, bot ...

thank you very much




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3