Why is the top 5 results 0 when converting the model

Which Khadas SBC do you use?

Vim 3

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu 20.04

When I convert my own model, the top 5 result value is 0. Is this normal?

image

All my processes of these stages are in the video link below.
please watch the video while replying

thanks.

Hey @Frank,
please could you interest my problem

@ahmet_karazor Maybe the conversion parameter is wrong and I’m not sure what the problem is

@Frank,

What do you think is wrong with the conversion parameters? . The only documentation on conversion is the docs on khadas own site. I made these docs step by step as in my video. I need to run this model so help.

I give the conversion steps again below.

conversion parameter of 0_import_model.sh :

NAME=yolox
ACUITY_PATH=…/bin/

pegasus=${ACUITY_PATH}pegasus
if [ ! -e “$pegasus” ]; then
pegasus=${ACUITY_PATH}pegasus.py
fi

$pegasus import onnx
–model ${NAME}.onnx
–output-data ${NAME}.data
–output-model ${NAME}.json

#generate inpumeta --source-file dataset.txt
$pegasus generate inputmeta
–model ${NAME}.json
–input-meta-output ${NAME}_inputmeta.yml
–channel-mean-value “0 0 0 0.00390625
–source-file dataset.txt

conversion parameter of 1_quantize_model.sh :

NAME=yolox
ACUITY_PATH=…/bin/

pegasus=${ACUITY_PATH}pegasus
if [ ! -e “$pegasus” ]; then
pegasus=${ACUITY_PATH}pegasus.py
fi

#–quantizer asymmetric_affine --qtype uint8
#–quantizer dynamic_fixed_point --qtype int8(int16,note s905d3 not support int16 quantize)
$pegasus quantize
–quantizer dynamic_fixed_point
–qtype int8
–rebuild
–with-input-meta ${NAME}_inputmeta.yml
–model ${NAME}.json
–model-data ${NAME}.data \

conversion parameter of 2_export_case_code.sh :

NAME=yolox
ACUITY_PATH=…/bin/

pegasus=$ACUITY_PATH/pegasus
if [ ! -e “$pegasus” ]; then
pegasus=$ACUITY_PATH/pegasus.py
fi

$pegasus export ovxlib
–model ${NAME}.json
–model-data ${NAME}.data
–model-quantize ${NAME}.quantize
–with-input-meta ${NAME}_inputmeta.yml
–dtype quantized
–optimize VIPNANOQI_PID0X88
–viv-sdk ${ACUITY_PATH}vcmdtools
–pack-nbg-unify
rm -rf ${NAME}_nbg_unify
mv …/*_nbg_unify ${NAME}_nbg_unify
cd ${NAME}_nbg_unify
mv network_binary.nb ${NAME}.nb
cd …
#save normal case demo export.data
mkdir -p ${NAME}_normal_case_demo
mv *.h *.c .project .cproject *.vcxproj BUILD *.linux *.export.data ${NAME}_normal_case_demo
#rm *.h *.c .project .cproject *.vcxproj BUILD *.linux *.export.data
rm *.data *.quantize *.json *_inputmeta.yml

@ahmet_karazor If you are using yolox, not yolov3, please write your own pre-processing and post-processing functions. It is not generic.

Dear @Frank,

I know your demo doc is not generic. Model conversion must be done correctly before changing post and pre process files. Below is the file obtained after the model transformation.

However, since the Top5 results obtained as a result of the model transformation are zero, I think there is a problem in the model transformation. Wouldn’t it be a problem if the results were zero?

@Frank Do you have any idea?

@ahmet_karazor If I remember correctly, the top5 of the normal yolov3 model conversion is also 0, my suggestion is that you sum all the outputs to see if they are all 0