Toybrick

RKNN1.3.0 转换Pytorch模型 遇到KeyError

viwoqu

注册会员

积分
77
楼主
发表于 2020-3-27 16:01:32    查看: 7400|回复: 3 | [复制链接]    打印 | 只看该作者
第一个模型遇到
E Traceback (most recent call last):
E   File "rknn\api\rknn_base.py", line 567, in rknn.api.rknn_base.RKNNBase.load_pytorch
E   File "rknn\base\RKNNlib\app\importer\import_pytorch.py", line 95, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 517, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.__init__
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 601, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.model_simplify
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 104, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 139, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E KeyError: 'aten::grid_sampler'
Load pytorch model failed!


第二个模型遇到
E Traceback (most recent call last):
E   File "rknn\api\rknn_base.py", line 567, in rknn.api.rknn_base.RKNNBase.load_pytorch
E   File "rknn\base\RKNNlib\app\importer\import_pytorch.py", line 95, in rknn.base.RKNNlib.app.importer.import_pytorch.ImportPytorch.run
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 517, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.__init__
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 601, in rknn.base.RKNNlib.converter.convert_pytorch.convert_pytorch.model_simplify
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 104, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 139, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 337, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.mean_shape
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 104, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 139, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 247, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.convolution_shape
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 104, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 139, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 196, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.cat_shape
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 104, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 139, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 190, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.list_construct_shape
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 104, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 139, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 211, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.elementwise_boardcast_shape
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 104, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 139, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 337, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.mean_shape
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 104, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.shape_pick
E   File "rknn\base\RKNNlib\converter\convert_pytorch.py", line 139, in rknn.base.RKNNlib.converter.convert_pytorch.torch_inference_engine.__ir_shape_inference
E KeyError: 'aten::pow'
Load pytorch model failed!


应该是这两个OP没有实现,
1 有没有支持的OP算子列表?
2 自己如何自定义上述不支持的算子?
回复

使用道具 举报

jefferyzhang

版主

积分
13580
沙发
发表于 2020-3-27 16:32:21 | 只看该作者
自定义OP rknntoolkit文档里有描述。。。。
回复

使用道具 举报

viwoqu

注册会员

积分
77
板凳
 楼主| 发表于 2020-3-27 16:37:23 | 只看该作者
jefferyzhang 发表于 2020-3-27 16:32
自定义OP rknntoolkit文档里有描述。。。。

文档里说 自定义OP只支持TensorFlow
Pytorch转码遇到这问题 咋解决
回复

使用道具 举报

jefferyzhang

版主

积分
13580
地板
发表于 2020-3-27 17:32:47 | 只看该作者
这个op我帮你反馈上去,看下能不能处理。
请问下这个模型用的是哪个?能否给个链接和转换脚本。
回复

使用道具 举报

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

本版积分规则

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


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