Default Avatar

Andy Hsieh

Andy Hsieh

About

Username
Andy Hsieh
Joined
Visits
1,170
Last Active
Roles
Member, ModeratorsKL520, ModeratorsKL720, ModeratorsAIModel

Comments

  • @Tim Hi Tim, 我這邊已經幫您測試過了您提供的 Script 了,是沒有問題的。 通常這邊會建議您在做 calibration ( Step 5: Quantization km.analysis) 的時候,圖片大約 100 張。 幫您測試過了,我找了約 20M 的 100 張圖,是可以在 docker occupied memory (RAM),memo…
  • @Tim Hi Tim, 您的問題,看起來是在 Step 5: Quantization 做 km.analysis 出錯,不知道您是否可以提供您的 model 跟您跑的完整 Scripts,還有您做 calibration 時會出錯的那些圖片,方便讓我們找出問題並改善 ToolChain。
  • @yp Hi yp, I'm glad to help you. This is because the operators supported by the KL520 can be 100% sure that they cannot support sigmoid, but you mentioned that the other two unsupported operators (Reshape and Transpose) are supported in some cases,…
  • @范太恩 Hi 范太恩, 目前已經確認,我這裡跟您一樣在推論的時候會出現問題,我已經把問題提交到相關部門進行再次確認,等有消息會再通知您。
  • @yp Hi yp, Hello, I have seen that your model contains an operator (sigmoid), which KDP520 NPU (platform=520) does not support, so you can put your sigmoid on your post process. Another way solution, you can use KDP720 NPU (platform = 720), this wi…
  • @yp Hi yp, Based on your scripts and error messages, you mean that you passed 'Section 4. E2E Simulator Check (Fixed Point)' and generated .nef success, but got an error on Section 6. E2E Simulator Check (Hardware)? If yes, can you provide your mod…
  • @范太恩 Hi 范太恩, 根據這些資訊,我認為 model 的轉換是沒有問題的,而是出現在 Inference 的時候發生問題。 您是否可以提供您的 Inference script,讓我們找出 Error: inference failed 的原因。
  • @Kuan Hi Kuan, 看了您的錯誤訊息與 model 架構,造成 km.analysis 錯誤原因,初步判斷可能是因為 model 的架構有不符合硬體的架構 (ex. Reshape、Transpose等),或是在轉換 model 沒有成功的 onnx optimize 導致錯誤。 不過,您提供的資訊不好判斷具體情況,可以的話…
  • @范太恩 Hi 范太恩, 根據我執行您的 script 以後,您的問題大致上有三個地方可以回答您, 從您的錯誤訊息看下來,您是有成功生成 520.nef 檔的,位置位於 '/workspace/osa3/nef/' ,您可以檢查看看。 出現錯誤訊息的原因是因為最後的 E2E simulator 所導致。 hw_resu…
  • @范太恩 Hi 范太恩, 您是否可以提供一下您的 /workspace/osa3/T_wav/S/ 還有 /workspace/osa3/T_wav/BS/ 內的一點 .wav 讓我執行看看?
  • @Kuan Hi Kuan, 因為您提供的資訊不太足夠,我不好判斷,所以是否可以提供您跑的 scripts 還有 model。 回答您的問題,如果您使用 ktc.onnx_optimizer.tflite2onnx_flow 指令來轉換 tflite 的 model 是沒有辦法像 h5 一樣指定 input shape 的。
  • @Kuan Hi Kuan, 看了您的錯誤訊息,可能是在您的 script 裡面,您的input dimensions 設置錯誤。 您可以確認一下您的 input_image input size 是什麼,確認完成之後檢查您的 script 內的 input dimensions 是否符合您模型 input size。
  • @liron Hi liron, Sorry for the late reply. The cause of the error message has been found, we will improve this problem in the next version of Kneron ToolChain.
  • @liron Hi liron, Thank you for providing the .onnx model and toolchain python script. We are still looking for the cause of the error message. If there is any new progress, we will report back to you at any time.
  • @liron Hi liron, Can you provide your onnx model so that we can troubleshoot this issue?
  • @Lin Hsiehcheng Hi Lin Hsiehcheng, The TensorFlow version should not cause this wrong result. Here are two points to show you. 1. The Forezen_model.pb you provided contains a lot of preprocess and postporcess because preprocess and postporcess may…
  • @Lin Hsiehcheng Hi Lin Hsiehcheng, The mobilenetv2-7.onnx model you want to port is a PyTorch generated model, so you must use "Pytorch exported onnx optimization. API"(http://doc.kneron.com/docs/#toolchain/python_api/#pytorch-exported-on…
  • @Mason Hi Mason, Currently we do not support the structure of LSTM, but we are planning to support it.
  • @范太恩 Hi 范太恩, 看到您的 script (KL520KnModelZooGenericInferenceClassificationOSA.py), 您的 image input 的維度可能要改一下,改成(64, 256, 1) ,也就是您只要註解掉第166行 (移除這行image = np.expand_dims(image, axis=0)) 就可以成功執行推論。 順便…
  • @范太恩 Hi 范太恩, 不知道您是否可以提供"s.wav",讓我們方便測試一下。
  • https://www.kneron.com/forum/discussion/comment/751#Comment_751 @fenix.lam Hi Fenix, That's right. 🙂 Have you successfully executed Kneron Toolchain docker?
  • @fenix.lam Hi Fenix, If your computer has D:\docker (If not, create a folder in D:\docker), Then, You can use the following commands directly in the cmd of windows to try. docker run --rm -it -v D:\docker:/docker_mount kneron/toolchain:latest https:…
  • @fenix.lam Hi Fenix, I want to confirm whether you have to Pull the latest toolchain image. You can use the following commands under your Windows command line to use Kneron Toolchain (remember to open "Docker Desktop" on your windows befo…
  • @范太恩 Hi 范太恩, 很高興您能順利解決您遇到問題。 我看過您的 script (python_api_workflow.py) 之後給您一個小建議,您在 Section4 做 Quantization 前,您的 input_mapping 內的 input_images 建議可以輸入一百張與模型推論相關的圖片,只有四張可能會影響到推…
  • @范太恩 Hi 范太恩, 不知道您是已經有 把 KL520 NPU 上不支援的 OP 去除後,再去做 ONNX to ONNX (ONNX optimization),再進行後續的 E2E Simulator Check。 看到您的錯誤訊息,應該是您沒有做 ONNX to ONNX (ONNX optimization),優化完以後再把您的 input_data 的…
  • @范太恩 Hi 范太恩, 您必須要把 KL520 NPU 上不支援的 OP 去除 (e.g. softmax)。🙂 在使用 Kneron ToolChain Docker 的情況下,IP Evaluation 後,您可以在 /data1/compiler/ 找到評估結果。 IP Evalution 主要是在評估您 model 的性能並檢查是否存在 Kneron ToolCha…
  • @Evelyn Hi Evelyn, 理論上是可行的,如果您想要再次確認你想要的 Model opeartors 是否符合 Kneron Hardware 架構,還可以經過 Kneron Document Center (http://doc.kneron.com/docs/#toolchain/manual/#3-onnx-workflow) 3.2 IP Evaluation 去取得評估結果。
  • @Evelyn Hi Evelyn, 是的,所以建議您在使用 Model 前可以確認您想要用的 Model 的結構是否支援 Kneron ToolChain Docker。 您可以參考 Kneron Document Center (http://doc.kneron.com/docs/#toolchain/manual/#2-toolchain-docker-overview) 2.3 Supported operato…