Forums - ONNX TopK operator cannot be converted to DLC

3 posts / 0 new
Last post
ONNX TopK operator cannot be converted to DLC
ryosuke.kamesawa1
Join Date: 8 Mar 21
Posts: 2
Posted: Thu, 2021-10-14 22:04

Hi,

I tried to convert an ONNX model with TopK operators. ( https://github.com/onnx/onnx/blob/master/docs/Operators.md#TopK ) According to the docs, the TopK operator seems to be supported ( https://developer.qualcomm.com/sites/default/files/docs/snpe/supported_o... ).

But snpe-onnx-to-dlc failed to convert the onnx model. Error messages are following:

Encountered Error: 'ERROR_METHOD_NOT_FOUND_FOR_OP_TYPE: Method add_op_to_backend not found for op_type topk'
Stack Trace:
Traceback (most recent call last):
  File "/opt/snpe/bin/x86_64-linux-clang/snpe-onnx-to-dlc", line 51, in <module>
    backend.save(optimized_graph)
  File "/opt/snpe/lib/python/qti/aisw/converters/backend/ir_to_dlc.py", line 151, in save
    DlcTranslations.apply_method_to_all_ops(BackendTranslationBase.ADD_OP_TO_BACKEND, graph, self)
  File "/opt/snpe/lib/python/qti/aisw/converters/common/converter_ir/translation.py", line 75, in apply_method_to_all_ops
    (method_name, node.op.type))
KeyError: 'ERROR_METHOD_NOT_FOUND_FOR_OP_TYPE: Method add_op_to_backend not found for op_type topk'
Are there any workaround? Or SNPE cannot handle TopK operators yet?
 
Thanks.
  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Sun, 2022-01-09 17:17

Dear customer,

What's a feature your model hopes to build?

Could you please help to share the model to us as more deeply research?

BR.

Wei

  • Up0
  • Down0
SahilBandar
Join Date: 23 May 18
Posts: 37
Posted: Tue, 2022-02-01 20:27

Hi ryosuke.kamesawa1,

Make sure that your ONNX model is converted with opset version 1, 10, 11.
TopK supported with Opcode 10 & 11.

Regards,
Sahil Bandar

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.