Toybrick

标题: RKNN1.3.0 转换Pytorch模型 遇到KeyError [打印本页]

作者: viwoqu    时间: 2020-3-27 16:01
标题: RKNN1.3.0 转换Pytorch模型 遇到KeyError
第一个模型遇到
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    时间: 2020-3-27 16:32
自定义OP rknntoolkit文档里有描述。。。。
作者: viwoqu    时间: 2020-3-27 16:37
jefferyzhang 发表于 2020-3-27 16:32
自定义OP rknntoolkit文档里有描述。。。。

文档里说 自定义OP只支持TensorFlow
Pytorch转码遇到这问题 咋解决
作者: jefferyzhang    时间: 2020-3-27 17:32
这个op我帮你反馈上去,看下能不能处理。
请问下这个模型用的是哪个?能否给个链接和转换脚本。




欢迎光临 Toybrick (https://t.rock-chips.com/) Powered by Discuz! X3.3