Error code: 103. Description: ApiReturnCode.KP_FW_INFERENCE_TIMEOUT_103

I have successfully converted edgeconnect's edge model into .nef.

While testing inference code for the .nef model on KL720 dongle, I am getting bellow error.

my code and models are in the following link: https://github.com/HuangMason320/EdgeConnect

i use inference.py to testing inference and use onnx_edge.py to convert the onnx to nef.

the edge model i currently use is in TestModel

can you please help me to resolve this issue.

Comments

  • Hi,

    I've checked the onnx model PSV_edge_generator.onnx, and it has unsupported operators "InstanceNormalization" even after I optimized the model.

    A list of supported operators: Hardware Supported Operators - Document Center (kneron.com)

    We would recommend you to either:

    -Take out the unsupported nodes and retrain your model

    Or

    -Use a different model with operators our NPU supports

    Also, we recommend you to run through the E2E simulators by using ktc.kneron_inference() with onnx model, bie model, and nef model. A valid model should pass through all the simulators without any errors.

    Please refer to: 3. Floating-Point Model Preparation - Document Center (kneron.com)

  • Hi, Thanks for the responce above.

    I've change a model. And i still found some problem when using toolchain:

    i got "IndexError: list index (0) out of range" error when i use the onnx model i convert in host and copy to the docker using export_onnx.py and onnx2NEF.py

    I have used netron to check the operator, which seems correctly.

    Besides, the folder using google drive : https://drive.google.com/drive/folders/1HVHO25Q0v7HUWaeIGpwfu368dDtjuvFB?usp=drive_link


    I've use plenty of models but none of which are avaliable, can you please help me to resolve this issue.

  • Hi,

    Onnx models should be able to be converted to nef models as long as the operators are supported. Please refer to our documentation: Hardware Supported Operators - Document Center (kneron.com)

    We did not find the file onnx2NEF_KL520.py, so we used onnx2NEF.py to check. We've encountered the same error as you when we've tried to convert the onnx model. The model has a lot of operators unsupported by KL720 NPU, such as Cast and Div.

    We would recommend you to check the supported operators and take out Cast and other unsupported operators before converting the onnx model.

  • 嗨!

    非常感謝您的回覆~

    我目前在做的東西是在做根據mask進行該區域的圖像修復,但大部分的public model都具有不支援的operators。

    想請問是否能推薦過去嘗試過能在KL520或KL720上跑的相關model作為model的參考


    感謝您及團隊過去的幫忙

  • 你好,

    依據你的應用我們這邊可能沒有現成符合你需求的模型,但有關於模型的編修耐能這邊有針對幾個公開模型做實作範例,可以供你參考


    Yolov3: https://doc.kneron.com/docs/#toolchain/appendix/yolo_example/

    其他模型: https://doc.kneron.com/docs/#model_training/#_top

  • 暸解

    非常感謝


    再另外問一下,請問x = nn.ZeroPad2d(1)(x)中的ZeroPad2d是否是KL520所支援的operator?

    沒在doc中看到,只有Pad

  • 您好,

    如果您已經有model,可以直接把model export成onnx出來後,跑IP Evaluator看看就能確定有無支援了。有時候雖然Operator type有支援,但參數設定不好 (e.g. pad數值太大) NPU也可能沒辦法支援

    不過ZeroPad2d應該大機率會被轉成onnx的pad沒錯,像是keras的ZeroPadding2D:

    詳細資訊: ONNX Converter - Document Center (kneron.com)

  • 非常感謝您的回答

    在看過您提供的ONNX Converter後

    對於一些operator還是有一點疑問

    請問圖中的bias_add是否有支援,因為在doc中沒有看到

    非常感謝您的幫助

  • 您好,

    這個我不太確定,可能會需要麻煩您將這個model輸出成onnx,然後跑Kneron toolchain的IP Evaluator去得知是否支援。

    或是可以請您提供模型嗎? 謝謝!

  • edited September 2024

    您好,我目前在檢查這個model,不太確定ReflectionPad2d和AdaptiveAvgPool2d是否可以轉換成KL720所支援的onnx operator

    使用的model和Code在:https://github.com/yeates/MMT

    非常感謝您的解惑

  • 您好,

    我們不是對所有platforms的operators很熟悉,所以建議您先去將模型轉換成onnx模型然後提供onnx模型給我們,我們才有辦法用IP Evaluator去查onnx模型喔,不好意思麻煩您了!

  • 您好

    這是我目前使用的Model和對應的Code:https://drive.google.com/drive/folders/10ZcA4HXdON1xJk101Dvglf8LAy_4xOuB?usp=drive_link

    使用的是model.onnx和onnx2NEF.py及pth2onnx.py

    model.onnx使用兩個input分別是[1,4,256,256]的input,和[1,3,256,256]的mask

    我能夠順利通過IP Evaluation但是在進行NEF File轉換的時候會出現問題

    想請問是否有支援使用兩個input的onnx轉換,還是說有哪個地方有出現錯誤

    非常感謝


  • 您好,

    除了KL520以外都會支援multiple inputs,但是您的model (model.onnx) 經過optimize之後,還是會有不支持的operators (像是Exp, Where, etc.)。

    轉換模型時,一般會用IP Evaluator去檢查後,再來用Netron之類的工具去檢查onnx有沒有不支援的operators。不好意思,但是我們會建議您使用其他的models,或是可以自行修改model。

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