From 7dd18c0d2e354916bcccfa5333f110b325cebb01 Mon Sep 17 00:00:00 2001 From: meng_chunyang Date: Thu, 27 Aug 2020 14:44:05 +0800 Subject: [PATCH] update the copy rules for fp16 models --- mindspore/lite/test/models_fp16.cfg | 6 +++--- mindspore/lite/test/run_benchmark_nets.sh | 21 ++++++++++----------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/mindspore/lite/test/models_fp16.cfg b/mindspore/lite/test/models_fp16.cfg index e1abfab54cd..f229177bcd9 100644 --- a/mindspore/lite/test/models_fp16.cfg +++ b/mindspore/lite/test/models_fp16.cfg @@ -1,7 +1,7 @@ detect-deeper-halfdeeper-mbv1-shortcut-400-400_nopostprocess_simplified.fp16 -model_emotions_0727_nosoftmax.fp16 +model_emotions_0727_nosoftmax.tflite.fp16 mtk_isface.fp16 mtk_landmark.fp16 mtk_pose_tuku.fp16 -mtk_age_gender.fp16 -mtk_model_face_dress.fp16 +mtk_age_gender.tflite.fp16 +mtk_model_face_dress.tflite.fp16 diff --git a/mindspore/lite/test/run_benchmark_nets.sh b/mindspore/lite/test/run_benchmark_nets.sh index 1d7c61b479a..ae5f15d651a 100644 --- a/mindspore/lite/test/run_benchmark_nets.sh +++ b/mindspore/lite/test/run_benchmark_nets.sh @@ -403,17 +403,6 @@ rm -rf ${basepath}/ms_models mkdir -p ${basepath}/ms_models ms_models_path=${basepath}/ms_models -echo "start convert models ... :" -# Copy fp16 ms models: -while read line; do - model_name=${line} - if [[ $model_name == \#* ]]; then - continue - fi - echo "cp '${models_path}'/'${model_name}'.ms' ${ms_models_path}'/'${model_name}'.ms" >> "${run_benchmark_log_file}" - cp $models_path/${model_name}.ms ${ms_models_path}/${model_name}.ms -done < ${models_fp16_config} - # Convert tflite models: while read line; do model_name=${line} @@ -483,6 +472,16 @@ while read line; do ./converter_lite --fmk=TFLITE --modelFile=${models_path}/${model_name} --outputFile=${ms_models_path}/${model_name} --quantType=AwareTraining || Convert_status=$? done < ${models_tflite_awaretraining_config} +# Copy fp16 ms models: +while read line; do + model_name=${line%.*} + if [[ $model_name == \#* ]]; then + continue + fi + echo 'cp '${ms_models_path}'/'${model_name}'.ms' ${ms_models_path}'/'${model_name}'.fp16.ms' + cp ${ms_models_path}/${model_name}.ms ${ms_models_path}/${model_name}.fp16.ms +done < ${models_fp16_config} + # Check all result and return value if [[ ${Convert_status} = 0 ]];then echo "convert is ended"