Failure for model "input/input" when running "kdp720/HW not support"

I am getting above error while converting from onnx to nef format. There are few unsupported nodes as shown below. (But another model also has these nodes, but it successfully compiles for nef). How can i fix this?

I have attached error log, inference code

and screenshot for nodes present in the model. Some operators are not supported on the hardware, but is there any way to replace them as they cannot be deleted.


This the onnx model and pt model(please unzip):


This is inference code(please unzip):


Eagerly waiting for resolution

Comments

  • Hi Haresh,

    Sorry for the late reply. Could you provide us with your script for converting the onnx to nef as well? Thanks!

    The onnx model you've attached (effdet_kneron_ops.onnx) seems like it hasn't been optimized yet:


    You will need to optimize the model with onnx2onnx: 3. Floating-Point Model Preparation - Document Center (kneron.com)


    After that, if it still doesn't work, you can also try cutting unsupported nodes by using model editor:

    ONNX Converter - Document Center (kneron.com)

    3. Floating-Point Model Preparation - Document Center (kneron.com)

    And you can manually add them in your postprocessing code to replace the ones cut out from your model.

  • Thank you for the reply. The model i have attached is not optimised, but I am doing optimization while converting the onnx to nef. I am attaching optimized onnx and script to convert onnx to nef in below folder (please unzip):

    Please take a look at the nef conversion script for any corrections.

  • Hi Haresh,

    Our model team checked your script, and it looks okay.

    Before converting your model, we would suggest you to follow these steps:

    1. Use onnx-simplifier to simplify your original onnx model (Note: not the optimized one)
    2. Run onnx2onnx
    3. Since there are nodes that aren't supported by KL720 (such as ReduceMax, Gather, Exp, etc.), you could use model editor (editor.py) to cut off all the nodes after Transpose (including Transpose too). You could cut them off, then add back the nodes that were cut off in your post process function. Either that, or you could come up with a way to change these nodes to nodes that are supported by KL720

    After going through these steps, your onnx file could be converted to nef file by running your script.

    Supported operators: Hardware Supported Operators - Document Center (kneron.com)

    Model editor: ONNX Converter - Document Center (kneron.com)

The discussion has been closed due to inactivity. To continue with the topic, please feel free to post a new discussion.