3,298
社区成员




使用snpe把onnx转成dlc的时候报错:
Traceback (most recent call last): File "/home/adil/snpe/snpe-1.61.0.3358/lib/python/qti/aisw/converters/onnx/onnx_to_ir.py", line 231, in convert src_op.op_type) File "/home/adil/snpe/snpe-1.61.0.3358/lib/python/qti/aisw/converters/common/converter_ir/translation.py", line 48, in apply_method_to_op translation = self.__get_translation(op_type) File "/home/adil/snpe/snpe-1.61.0.3358/lib/python/qti/aisw/converters/common/converter_ir/translation.py", line 35, in __get_translation "Op is most likely not supported by the converter." % op_type) KeyError: 'No translation registered for op type onnx_hardsigmoid. Op is most likely not supported by the converter.' 2023-10-19 11:28:15,854 - 209 - ERROR - Node /backbone/backbone/stem/conv/act/HardSigmoid: 'No translation registered for op type onnx_hardsigmoid. Op is most likely not supported by the converter.
您好,从log中分析,您使用的是SNPE-1.61。这个问题出在HardSigmoid这个算子本身是snpe-2.20才开始支持的,1.61还不支持。如果您知道模型中的什么位置使用了这个算子,您可以将其替换成其他激活函数,或者将其拆解为更基础的表示;如果您找不到您在哪里使用了HardSigmoid,那大概率是因为您使用了pytorch自带的HSwish算子。Pytorch自带的HSiwsh算子使用的是xHardSigmoid的表述,您可以自定义一个HSwish,将其改成xnn.functional.relu6(x+3, inplace=True)/6的表述。