Toybrick

【已解决!】RKNN转换Tensorflow官方的Deeplabv3后inference结果不

protossw512

中级会员

积分
252
楼主
发表于 2019-3-5 05:11:15    查看: 20767|回复: 18 | [复制链接]    打印 | 只看该作者
本帖最后由 protossw512 于 2019-3-6 07:32 编辑

问题已经解决了,原因是中间层的输出是channel first的,所以reshap的时候需要注意。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

raul

中级会员

积分
235
沙发
发表于 2019-3-5 16:17:58 | 只看该作者
谢谢反馈,我这里复现下。
回复

使用道具 举报

protossw512

中级会员

积分
252
板凳
 楼主| 发表于 2019-3-5 16:28:55 | 只看该作者
raul 发表于 2019-3-5 16:17
谢谢反馈,我这里复现下。

顺便一说,我在这里调出了第一层conv(MobilenetV2/Conv/Conv2D)的结果,发现已经不对了。
然后我尝试避免使用rknn自带的图像归一化,直接用 (0. 0. 0. 1.0),然后自己把图像转成np.float32,再自己做归一化,结果inference的时候出现了segmentation fault不知道为什么,np.float16也不行。
我的quantization一直都没开。
有没有其他什么办法能调出rknn归一化后输入网络之前的数据么?
回复

使用道具 举报

protossw512

中级会员

积分
252
地板
 楼主| 发表于 2019-3-6 03:26:07 | 只看该作者
raul 发表于 2019-3-5 16:17
谢谢反馈,我这里复现下。

你好,问题已经解决了,原因是中间层的输出是channel在前面的,所以最后的输出reshape不应该是1, 65, 65, 21, 而应该是1, 21, 65, 65。然后再np.transpose成 1, 65, 65, 21进行处理。

非常感谢大家的帮助!
回复

使用道具 举报

raul

中级会员

积分
235
5#
发表于 2019-3-6 09:31:53 | 只看该作者
protossw512 发表于 2019-3-6 03:26
你好,问题已经解决了,原因是中间层的输出是channel在前面的,所以最后的输出reshape不应该是1, 65, 65, ...

好的。我这里验证也是结果没错。
回复

使用道具 举报

chuyee

中级会员

积分
352
6#
发表于 2019-3-8 07:56:36 | 只看该作者
What's the inference time do you get for DeepLabv3? Is it possible for less than 1s?
回复

使用道具 举报

protossw512

中级会员

积分
252
7#
 楼主| 发表于 2019-3-8 14:25:30 | 只看该作者
chuyee 发表于 2019-3-8 07:56
What's the inference time do you get for DeepLabv3? Is it possible for less than 1s?

Deeplabv3+ is not actually as computation intensive as you think of. Depending on your network architecture, you can run mobilnetv2_dm0.5 up to 15 fps with input size of 513x513.
回复

使用道具 举报

chuyee

中级会员

积分
352
8#
发表于 2019-3-11 10:07:53 | 只看该作者
protossw512 发表于 2019-3-8 14:25
Deeplabv3+ is not actually as computation intensive as you think of. Depending on your network arc ...

That's amazing!
回复

使用道具 举报

chuyee

中级会员

积分
352
9#
发表于 2019-3-11 11:50:26 | 只看该作者
protossw512 发表于 2019-3-8 14:25
Deeplabv3+ is not actually as computation intensive as you think of. Depending on your network arc ...

What does "mobilnetv2_dm0.5" stand for? I got only ~1.2s with GTX 1080 Ti with the demo code https://github.com/tensorflow/mo ... /deeplab_demo.ipynb, which uses model deeplabv3_mnv2_pascal_train_aug_2018_01_29.tar.gz (513x513, mobilenet_v2 coco dataset). I haven't ported it to rknn successfully yet. But do you think I can achieve 15FPS after the porting?
回复

使用道具 举报

chuyee

中级会员

积分
352
10#
发表于 2019-3-12 02:28:13 | 只看该作者

你的输入层设的是 MobilenetV2/Conv/Conv2D吧?那前面那些层都在CPU上处理吗?mobilenet_v2在rknn上到40fps都没问题。问题是加上前期和后期的处理后你处理一副513x513的图片在3399pro上需要多少秒呢?
回复

使用道具 举报

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

本版积分规则

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


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