Toybrick

标题: ptorch 转换失败(rk3568) [打印本页]

作者: ameRk    时间: 2022-7-14 14:53
标题: ptorch 转换失败(rk3568)
平台为 rk3568,训练好的pytorch模型,按照example进行转换,失败,提示如下信息:RuntimeError: [enforce fail at inline_container.cc:222] . file not found: archive/constants.pkl
请问是不是对pytorch的版本有要求啊?

作者: jefferyzhang    时间: 2022-7-15 09:55
file not found: archive/constants.pkl
作者: ameRk    时间: 2022-7-15 11:05
jefferyzhang 发表于 2022-7-15 09:55
file not found: archive/constants.pkl

将pth模型转换为 torchscript 后,报错如下:
这个 rknn-toolkit2 没有对应的 ['aten::clamp_min'] 吗?
W __init__: rknn-toolkit2 version: 1.3.0-11912b58

--> Config model
W config: 'target_platform' is None, use rk3566 as default, Please set according to the actual platform!
done
--> Loading model
E load_pytorch: The following operators are not implemented: ['aten::clamp_min']
W load_pytorch: ===================== WARN(2) =====================
E rknn-toolkit2 version: 1.3.0-11912b58
W load_pytorch: Catch exception when loading pytorch model: ValueError("The following operators are not implemented: ['aten::clamp_min']",)
E load_pytorch: Traceback (most recent call last):
E load_pytorch:   File "rknn/api/rknn_base.py", line 1310, in rknn.api.rknn_base.RKNNBase.load_pytorch
E load_pytorch:   File "rknn/base/convertor/torch2onnx/pytorch.py", line 4209, in rknn.base.convertor.torch2onnx.pytorch.from_pytorch
E load_pytorch:   File "rknn/base/convertor/torch2onnx/pytorch.py", line 3341, in rknn.base.convertor.torch2onnx.pytorch.PyTorchOpConverter.report_missing_conversion
E load_pytorch:   File "rknn/api/rknn_log.py", line 113, in rknn.api.rknn_log.RKNNLog.e
E load_pytorch: ValueError: The following operators are not implemented: ['aten::clamp_min']
W load_pytorch: Load_pytorch exception! Try another methed!
done
--> Building model
Build model failed!
作者: jefferyzhang    时间: 2022-7-15 11:16
是的,从log来看就是aten::clamp_min这个算子不支持。
那就有3种做法:
要么你自定义op,
要么改模型改掉这个op
要么如果这个op在头或者尾,就拉出来自己实现,不用放rknn里




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