你好,按照教程把自定义训练的tf下的mobilenetv1执行以下步骤:
Step1: 0_import_model.sh
Setp2: 1_quantize_model.sh
Step3: 2_export_case_code.sh
环境是: khadas VIM3,所使用的sdk版本是6.4.2.1,模型是由tf2.0下转为tflite,然后再使用工具转*.json和*.data
错误如下:
~$ ./2_export_case_code_vim3.sh MobileNetV1FLower1_0__022
Traceback (most recent call last):
File "ovxgenerator.py", line 195, in <module>
File "ovxgenerator.py", line 127, in main
ValueError: could not convert string to float:
[11566] Failed to execute script ovxgenerator
这个"ovxgenerator.py"文件,我grep一下,没有找到,看不到对应的报错地方,请问是哪里我疏忽了?
`cat ./0_import_model.sh`
if [ ! -n "$1" ] ;then
echo "you have to select a Model File!"
exit
fi
NAME=$1
ACUITY_PATH=../acuity-toolkit/bin/
rm -rf convert2aml
mkdir convert2aml
convert_tflite=${ACUITY_PATH}convertflite
$convert_tflite \
--tflite-mode model-tflite/${NAME}.tflite \
--net-output convert2aml/${NAME}.json \
--data-output convert2aml/${NAME}.data
`cat ./1_quantize_model.sh`
if [ ! -n "$1" ] ;then
echo "you have to select a Model File!"
exit
fi
NAME=$1
ACUITY_PATH=../acuity-toolkit/bin/
tensorzone=${ACUITY_PATH}tensorzonex
#dynamic_fixed_point-i8 asymmetric_affine-u8
$tensorzone \
--action quantization \
--dtype float32 \
--source text \
--source-file ./data/validation_tf.txt \
--channel-mean-value '0 0 0 256' \
--model-input convert2aml/${NAME}.json \
--model-data convert2aml/${NAME}.data \
--quantized-dtype asymmetric_affine-u8 \
--quantized-rebuild
`cat ./2_export_case_code_vim3.sh`
if [ ! -n "$1" ] ;then
echo "you have to select a Model File!"
exit
fi
NAME=$1
ACUITY_PATH=../acuity-toolkit/bin/
export_ovxlib=${ACUITY_PATH}ovxgenerator
$export_ovxlib \
--model-input convert2aml/${NAME}.json \
--data-input convert2aml/${NAME}.data \
--reorder-channel '0 1 2' \
--channel-mean-value '0 0 0 256' \
--export-dtype quantized \
--model-quantize convert2aml/${NAME}.quantize \
--optimize VIPNANOQI_PID0X88 \
--viv-sdk ${ACUITY_PATH}vcmdtools \
--pack-nbg-unify
其中,step1和step2都有生成对应的文件,也没有报错。