Toybrick

onnx转换错误

zengwubin

中级会员

积分
274
发表于 2020-9-17 15:04:05    查看: 551|回复: 1 | [复制链接]    打印 | 显示全部楼层
转换mobilefacenet模型,pytorch转onnx,onnx模型测试没问题
onnx转RKNN时报错:
E ValueError: Dimensions must be equal, but are 64 and 56 for 'PRelu_PRelu_2_144_1/mul' (op: 'Mul') with input shapes: [64,1,1], [1,56,56,64].

是Prelu算子有什么要求吗?需要怎么修改呢
回复

使用道具 举报

zengwubin

中级会员

积分
274
 楼主| 发表于 2020-9-18 13:27:52 | 显示全部楼层
你好, 经过调试我把PRelu [64,1,1], 改成[64]后转换报错:
E ValueError: Incompatible type conversion requested to type 'float32' for variable of type 'float64_ref'
E During handling of the above exception, another exception occurred:
E Traceback (most recent call last):
E   File "rknn/api/rknn_base.py", line 895, in rknn.api.rknn_base.RKNNBase.build
E   File "rknn/api/rknn_base.py", line 1797, in rknn.api.rknn_base.RKNNBase._quantize2
E   File "rknn/base/RKNNlib/app/medusa/quantization.py", line 105, in rknn.base.RKNNlib.app.medusa.quantization.Quantization.run
E   File "rknn/base/RKNNlib/app/medusa/quantization.py", line 44, in rknn.base.RKNNlib.app.medusa.quantization.Quantization._run_quantization
E   File "rknn/base/RKNNlib/app/medusa/workspace.py", line 139, in rknn.base.RKNNlib.app.medusa.workspace.Workspace.run
E   File "rknn/base/RKNNlib/app/medusa/workspace.py", line 109, in rknn.base.RKNNlib.app.medusa.workspace.Workspace._setup_graph
E   File "rknn/base/RKNNlib/app/medusa/workspace.py", line 110, in rknn.base.RKNNlib.app.medusa.workspace.Workspace._setup_graph
E   File "rknn/base/RKNNlib/RKNNnetbuilder.py", line 274, in rknn.base.RKNNlib.RKNNnetbuilder.RKNNNetBuilder.build
E   File "rknn/base/RKNNlib/RKNNnetbuilder.py", line 278, in rknn.base.RKNNlib.RKNNnetbuilder.RKNNNetBuilder.build
E   File "rknn/base/RKNNlib/RKNNnetbuilder.py", line 305, in rknn.base.RKNNlib.RKNNnetbuilder.RKNNNetBuilder.build_layer
E   File "rknn/base/RKNNlib/RKNNnetbuilder.py", line 305, in rknn.base.RKNNlib.RKNNnetbuilder.RKNNNetBuilder.build_layer
E   File "rknn/base/RKNNlib/RKNNnetbuilder.py", line 305, in rknn.base.RKNNlib.RKNNnetbuilder.RKNNNetBuilder.build_layer
E   [Previous line repeated 3 more times]
E   File "rknn/base/RKNNlib/RKNNnetbuilder.py", line 331, in rknn.base.RKNNlib.RKNNnetbuilder.RKNNNetBuilder.build_layer
E   File "rknn/base/RKNNlib/RKNNnetbuilder.py", line 336, in rknn.base.RKNNlib.RKNNnetbuilder.RKNNNetBuilder.build_layer
E   File "rknn/base/RKNNlib/layer/RKNNlayer.py", line 287, in rknn.base.RKNNlib.layer.RKNNlayer.RKNNLayer.compute_tensor
E   File "rknn/base/RKNNlib/layer/fullconnect.py", line 104, in rknn.base.RKNNlib.layer.fullconnect.FullConnect.compute_out_tensor
E   File "/home/zengwb/anaconda3/envs/rk/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 301, in add
E     "Add", x=x, y=y, name=name)
E   File "/home/zengwb/anaconda3/envs/rk/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 546, in _apply_op_helper
E     inferred_from[input_arg.type_attr]))
E TypeError: Input 'y' of 'Add' Op has type float64 that does not match type float32 of argument 'x'.


QQ群里问过饶洪叫我论坛提交模型debug, 帮忙看看问题,急!谢谢
回复

使用道具 举报

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

本版积分规则

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


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