forked from mindspore-Ecosystem/mindspore
!4574 fix post training quant
Merge pull request !4574 from xutianchun/quant_st
This commit is contained in:
commit
c9062e1428
|
@ -65,6 +65,27 @@ function Run_x86() {
|
||||||
fi
|
fi
|
||||||
done < ${models_onnx_config}
|
done < ${models_onnx_config}
|
||||||
|
|
||||||
|
# Run tflite post training quantization converted models:
|
||||||
|
while read line; do
|
||||||
|
model_name=${line}
|
||||||
|
if [[ $model_name == \#* ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
echo ${model_name}
|
||||||
|
echo 'cd '${convertor_path}'/MSLite-*-linux_x86_64'
|
||||||
|
cd ${convertor_path}/MSLite-*-linux_x86_64 || return 1
|
||||||
|
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib;./benchmark/benchmark --modelPath='${ms_models_path}'/'${model_name}'_posttraining.ms --inDataPath=/home/workspace/mindspore_dataset/mslite/quantTraining/mnist_calibration_data/00099.bin --calibDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/'${model_name}'_posttraining.ms.out --warmUpLoopCount=1 --loopCount=1' || return 1
|
||||||
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:./lib;./benchmark/benchmark --modelPath=${ms_models_path}/${model_name}_posttraining.ms --inDataPath=/home/workspace/mindspore_dataset/mslite/quantTraining/mnist_calibration_data/00099.bin --calibDataPath=/home/workspace/mindspore_dataset/mslite/models/hiai/input_output/output/${model_name}_posttraining.ms.out --warmUpLoopCount=1 --loopCount=1
|
||||||
|
if [ $? = 0 ]; then
|
||||||
|
run_result='Run_x86: '${model_name}'_posttraining pass'
|
||||||
|
echo ${run_result} >> ${run_benchmark_result_file}
|
||||||
|
else
|
||||||
|
run_result='Run_x86: '${model_name}'_posttraining fail <<===========================this is the failed case'
|
||||||
|
echo ${run_result} >> ${run_benchmark_result_file}
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done < ${models_tflite_posttraining_config}
|
||||||
|
|
||||||
# Run mindspore converted models:
|
# Run mindspore converted models:
|
||||||
while read line; do
|
while read line; do
|
||||||
model_name=${line}
|
model_name=${line}
|
||||||
|
@ -257,8 +278,7 @@ while read line; do
|
||||||
fi
|
fi
|
||||||
echo ${model_name}
|
echo ${model_name}
|
||||||
echo './converter_lite --fmk=TFLITE --modelFile='${models_path}'/'${model_name}' --outputFile='${ms_models_path}'/'${model_name}_posttraining' --quantType=PostTraining --config_file='${models_path}'/'${model_name}'_posttraining.config'
|
echo './converter_lite --fmk=TFLITE --modelFile='${models_path}'/'${model_name}' --outputFile='${ms_models_path}'/'${model_name}_posttraining' --quantType=PostTraining --config_file='${models_path}'/'${model_name}'_posttraining.config'
|
||||||
###core dump 0815,after bugfix ,then add this convert:
|
./converter_lite --fmk=TFLITE --modelFile=$models_path/${model_name} --outputFile=${ms_models_path}/${model_name}_posttraining --quantType=PostTraining --config_file=${models_path}/${model_name}_posttraining.config || exit 1
|
||||||
###./converter_lite --fmk=TFLITE --modelFile=$models_path/${model_name} --outputFile=${ms_models_path}/${model_name}_posttraining --quantType=PostTraining --config_file=${models_path}/${model_name}_posttraining.config || exit 1
|
|
||||||
done < ${models_tflite_posttraining_config}
|
done < ${models_tflite_posttraining_config}
|
||||||
|
|
||||||
# Push to the arm and run benchmark:
|
# Push to the arm and run benchmark:
|
||||||
|
|
Loading…
Reference in New Issue