Toybrick

只一个单的全连接层,如何量化啊.onxx-> .pb 转rknn报错

xsky

中级会员

积分
388
楼主
发表于 2019-12-26 18:35:57    查看: 8128|回复: 1 | [复制链接]    打印 | 只看该作者
一层全连接 onnx, .pb:

如果这种向量输入的,怎么量化啊,主要是输入怎么搞呢?

pb为onnx转换的,onnx可以正常运行.pb报错:

I Current TF Model producer version 38 min consumer version 0 bad consumer version []
I Have 2 tensors convert to const tensor
D Const tensors:
D ['transposeut0', 'mul_1ut0']
I build output layer attach_addut0
I build input layer inputut0
D Try match Add add
I Match add [['add']] [['Add']] to [['add']]
D Try match Mul mul
I Match multiply [['mul']] [['Mul']] to [['multiply']]
D Try match Const mul_1_out_0_const
I Match const [['mul_1_out_0_const']] [['C']] to [['variable']]
D Try match Const mul/x
I Match const [['mul/x']] [['C']] to [['variable']]
D Try match MatMul MatMul
I Match matmul_fc [['MatMul', 'transpose_out_0_const']] [['MatMul', 'C']] to [['fullconnect']]
D Try match Reshape flatten/Reshape
I Match reshape [['flatten/Reshape', 'flatten/Reshape/shape']] [['Reshape', 'C']] to [['reshape']]
W Network may not support batch > 1 !
D connect mul_3 0  ~ add_2 0
D connect mul_1_out_0_const_4 0  ~ add_2 1
D connect mul/x_5 0  ~ mul_3 0
D connect MatMul_6 0  ~ mul_3 1
D connect flatten/Reshape_7 0  ~ MatMul_6 0
D connect attach_input/out0_1 0  ~ flatten/Reshape_7 0
D connect add_2 0  ~ attach_add/out0_0 0
D Process mul/x_5 ...
D RKNN output shape(variable): (1)
D Process attach_input/out0_1 ...
D RKNN output shape(input): (0 120)
D Process flatten/Reshape_7 ...
D RKNN output shape(reshape): (0 120)
D Process MatMul_6 ...
D RKNN output shape(fullconnect): (0 3)
D Process mul_3 ...
D RKNN output shape(multiply): (1 3)
D Process mul_1_out_0_const_4 ...
D RKNN output shape(variable): (3)
D Process add_2 ...
D RKNN output shape(add): (1 3)
D Process attach_add/out0_0 ...
D RKNN output shape(output): (1 3)
I Build fc{120,3} complete.
D Optimizing network with force_1d_tensor, swapper, merge_layer, auto_fill_bn, resize_nearest_transformer, auto_fill_multiply, merge_avgpool_conv1x1, auto_fill_zero_bias, proposal_opt_import
D Merge ['MatMul_6', 'mul_3'] (fullconnect)
E Catch exception when loading tensorflow model: pb/fc{120,3}.pb!
E Traceback (most recent call last):
E   File "rknn\api\rknn_base.py", line 201, in rknn.api.rknn_base.RKNNBase.load_tensorflow
E   File "rknn\base\RKNNlib\app\helper\mergehelper.py", line 145, in rknn.base.RKNNlib.app.helper.mergehelper.MergeHelper.merge
E   File "rknn\base\RKNNlib\optimize\optimizer.py", line 190, in rknn.base.RKNNlib.optimize.optimizer.Optimizer.apply
E   File "rknn\base\RKNNlib\optimize\rules\merge_layer.py", line 74, in rknn.base.RKNNlib.optimize.rules.merge_layer.MergeLayer.apply
E   File "rknn\base\RKNNlib\optimize\rules\merge_layer.py", line 98, in rknn.base.RKNNlib.optimize.rules.merge_layer.MergeLayer._loop
E   File "rknn\base\RKNNlib\optimize\rules\merge_layer_ext_proc.py", line 235, in rknn.base.RKNNlib.optimize.rules.merge_layer_ext_proc.m_l1_mul
E AttributeError: 'NoneType' object has no attribute 'const_data'









本帖子中包含更多资源

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

x
回复

使用道具 举报

jefferyzhang

版主

积分
13580
沙发
发表于 2019-12-27 08:26:44 | 只看该作者
W Network may not support batch > 1 !
我们batch不能和在网络里去增加的,理论上npu只支持一个batch,
如果有需要多batch,你网络也只能做成1个batch后通过我们rknn接口来增加batch
回复

使用道具 举报

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

本版积分规则

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


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