Hello Khadas,
Please advice:
The tengine demo applications failed to run with the following error:
E [vsi_nn_QuantCheck:423]input_scale[-784.305908] * weight_scale[0.177696] != bias_scale[-139.367645]
E [setup_node:449]Check node[0] CONV2D fail
Notes:
-
The NPU demo applications was build & run O.K. using the instructions from:
Description and Usage of aml_NPU_app Code Repository -
The tengine demo applications was build by following the instructions from:
How To Use Tengine SDK
How To Compile And Run Tengine Demo
Details - build & run of the failed tengine demo
Convert the model to Yolo format
- ssh to Ubuntu 18.04 machine
- From How To Use Tengine SDK - convert the model on the x64 machine - https://docs.khadas.com/vim3/HowToUseTengineSDK.html
- Get sources
workspace=/opt/noveto/src/VIM3.NPU/aml_npu_sdk_6.4.3/workspace
cd ${workspace}
git clone https://gitlab.com/khadas/tengine_khadas_sdk.git && cd tengine_khadas_sdk - Get yolov3 original files
wget --timestamp https://pjreddie.com/media/files/yolov3.weights wget --timestamp
https://raw.githubusercontent.com/yan-wyb/darknet/master/cfg/yolov3.cfg - Convert and quant
cd ${workspace}/tengine_khadas_sdk/tengine_tools/quant_tool
./quant_tool -f darknet -m $workspace/tengine_khadas_sdk/yolov3.weights
-p $workspace/tengine_khadas_sdk/yolov3.cfg -o yolov3.tmfile
-a MINMAX -i $workspace/tengine_khadas_sdk/quant -x 128,128,128
-y 128,128,128 -z 416,416,3 -c INTERNAL -t UINT8 -n 100
Output:
major: 0, minor: 2, revision: 0, seen: 0, transpose: 0
===== Create tengine model file done: yolov3_FP32.tmfile and yolov3_UINT8.tmfile
Compile on VIM3 Ubuntu 20.04 machine
-
From How To Compile And Run Tengine Demo - https://docs.khadas.com/vim3/HowToUseTengineApp.html
-
ssh to VIM3 Ubuntu 20.04 machine with 1.0 kernel package
-
Check installed versions
$ uname -a Linux vim3-001 4.9.241 #4 SMP PREEMPT Sun Jan 31 16:54:45 IST 2021 aarch64 aarch64 aarch64 GNU/Linux
$ g++ --version
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
$ lsb_release -a
Description: Ubuntu 20.04.2 LTS
$ dpkg --status aml-npu | grep Version:
Version: 6.4.3CB-2
$ dpkg --status tengine-libs | grep Version:
Version: 1.2-pre -
Get sources from GIT
workspace=/opt/noveto/src/VIM3.NPU/aml_npu_sdk_6.4.3/workspace
cd ${workspace}
git clone https://gitlab.com/khadas/tengine_khadas_app.git && cd tengine_khadas_app -
Build
cd ${workspace}/tengine_khadas_app/yolov3-picture
bash -xv ./build-cv3.sh
cd ${workspace}/tengine_khadas_app/yolov3-camera
bash -xv ./build-cv3.sh -
Run
-
Picture application:
cd ${workspace}/tengine_khadas_app
./yolov3-picture/cv3_output/tengine_khadas_yolov3_picture
-m …/tengine_khadas_sdk/tengine_tools/quant_tool/yolov3_UINT8.tmfile
-i …/aml_npu_demo_binaries/detect_demo_picture/1080p.bmp
Output:
tengine-lite library version: TE-BU-P3002-Khadas-v1.0-R20201210
vsiplugin reshape output tensor addr is 0x55969822b0
vsiplugin reshape output tensor addr is 0x5596982350
vsiplugin reshape output tensor addr is 0x55969823f0
TENGINE_LAYOUT_NCHW goto RELEASE
E [vsi_nn_QuantCheck:423]input_scale[-784.305908] * weight_scale[0.177696] != bias_scale[-139.367645]
E [setup_node:449]Check node[0] CONV2D fail Setup graph failure. vsi_exec_graph == NULL
subgraph 0
prerun failed
scheduler->prerun failed
Prerun graph failed
-
Camera application:
cd ${workspace}/tengine_khadas_app
./yolov3-camera/cv3_output/tengine_khadas_yolov3_camera
-m …/tengine_khadas_sdk/tengine_tools/quant_tool/yolov3_UINT8.tmfile
-d /dev/video2Output:
tengine-lite library version: TE-BU-P3002-Khadas-v1.0-R20201210
vsiplugin reshape output tensor addr is 0x7f9c300b40
vsiplugin reshape output tensor addr is 0x7f9c300be0
vsiplugin reshape output tensor addr is 0x7f9c2fed70
TENGINE_LAYOUT_NCHW goto RELEASE
E [vsi_nn_QuantCheck:423]input_scale[-784.305908] * weight_scale[0.177696] != bias_scale[-139.367645]
E [setup_node:449]Check node[0] CONV2D fail
Setup graph failure.
vsi_exec_graph == NULL
subgraph 0 prerun failed
scheduler->prerun failed
Prerun graph failed