Toybrick

the differences between rknn v1.3 vs lower rknn version

nvnn

注册会员

积分
124
楼主
发表于 2020-2-28 10:19:49    查看: 8063|回复: 6 | [复制链接]    打印 | 只看该作者
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

版主

积分
13574
沙发
发表于 2020-2-28 10:25:41 | 只看该作者
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

注册会员

积分
124
板凳
 楼主| 发表于 2020-2-28 11:47:34 | 只看该作者
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

版主

积分
13574
地板
发表于 2020-2-28 12:20:24 | 只看该作者
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

注册会员

积分
124
5#
 楼主| 发表于 2020-2-28 12:25:16 | 只看该作者
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

版主

积分
13574
6#
发表于 2020-2-28 14:24:23 | 只看该作者
Update system by using apt upgrade/ dnf update, which will update librknn-api.so and npu-driver, both need 1.3.x.
回复

使用道具 举报

nvnn

注册会员

积分
124
7#
 楼主| 发表于 2020-2-28 16:25:53 | 只看该作者
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
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

产品中心 购买渠道 开源社区 Wiki教程 资料下载 关于Toybrick


快速回复 返回顶部 返回列表