diff --git a/test_tipc/benchmark_train.sh b/test_tipc/benchmark_train.sh index f178c4d184dbf68e8e50c217a50f51cc14adc489..3e41ad9a7158e7e2b33a6d213848f925f3fda3b9 100644 --- a/test_tipc/benchmark_train.sh +++ b/test_tipc/benchmark_train.sh @@ -88,7 +88,7 @@ lines=(${dataline}) model_name=$(func_parser_value "${lines[1]}") # 获取benchmark_params所在的行数 -line_num=`grep -n "train_benchmark_params" $FILENAME | cut -d ":" -f 1` +line_num=`grep -n -w "train_benchmark_params" $FILENAME | cut -d ":" -f 1` # for train log parser batch_size=$(func_parser_value "${lines[line_num]}") line_num=`expr $line_num + 1` @@ -144,6 +144,14 @@ if [ ! -n "$PARAMS" ] ;then device_num="N1C4" device_num_list=($device_num) run_mode="DP" +elif [[ ${PARAMS} = "dynamicTostatic" ]] ;then + IFS="|" + model_type=$PARAMS + batch_size_list=(${batch_size}) + fp_items_list=(${fp_items}) + device_num="N1C4" + device_num_list=($device_num) + run_mode="DP" else # parser params from input: modeltype_bs${bs_item}_${fp_item}_${run_mode}_${device_num} IFS="_" diff --git a/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt b/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt index 22c0357022fa27f79c97c3993322a1193c5f4ef5..7c0b3aa5b8e6dc34f4980fd9bea8d3b59ef82bf6 100644 --- a/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt +++ b/test_tipc/configs/yolov3/yolov3_darknet53_270e_coco_train_infer_python.txt @@ -17,7 +17,7 @@ norm_train:tools/train.py -c configs/yolov3/yolov3_darknet53_270e_coco.yml -o wo pact_train:tools/train.py -c configs/yolov3/yolov3_darknet53_270e_coco.yml --slim_config configs/slim/quant/yolov3_darknet_qat.yml -o fpgm_train:tools/train.py -c configs/yolov3/yolov3_darknet53_270e_coco.yml --slim_config configs/slim/prune/yolov3_darknet_prune_fpgm.yml -o distill_train:null -to_static_train:--to_static +null:null null:null ## ===========================eval_params=========================== @@ -57,4 +57,6 @@ repeat:3 --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile flags:null ===========================infer_benchmark_params=========================== -numpy_infer_input:3x608x608.npy \ No newline at end of file +numpy_infer_input:3x608x608.npy +===========================to_static_train_benchmark_params=========================== +to_static_train:--to_static \ No newline at end of file diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index e56d726ce22ba0f91734d27f3b55c983934dc47d..d5c09ccf09d56a5320abab9611311d930d9b3318 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -41,8 +41,8 @@ fpgm_key=$(func_parser_key "${lines[17]}") fpgm_trainer=$(func_parser_value "${lines[17]}") distill_key=$(func_parser_key "${lines[18]}") distill_trainer=$(func_parser_value "${lines[18]}") -to_static_key=$(func_parser_key "${lines[19]}") -to_static_trainer=$(func_parser_value "${lines[19]}") +trainer_key1=$(func_parser_key "${lines[19]}") +trainer_value1=$(func_parser_value "${lines[19]}") trainer_key2=$(func_parser_key "${lines[20]}") trainer_value2=$(func_parser_value "${lines[20]}") @@ -96,6 +96,9 @@ LOG_PATH="./test_tipc/output/${model_name}/${MODE}" mkdir -p ${LOG_PATH} status_log="${LOG_PATH}/results_python.log" +line_num=`grep -n -w "to_static_train_benchmark_params" $FILENAME | cut -d ":" -f 1` +to_static_key=$(func_parser_key "${lines[line_num]}") +to_static_trainer=$(func_parser_value "${lines[line_num]}") function func_inference(){ IFS='|' @@ -251,13 +254,16 @@ else elif [ ${trainer} = "${distill_key}" ]; then run_train=${distill_trainer} run_export=${distill_export} + elif [ ${trainer} = "${trainer_key1}" ]; then + run_train=${trainer_value1} + run_export=${export_value1} + elif [ ${trainer} = "${trainer_key2}" ]; then + run_train=${trainer_value2} + run_export=${export_value2} elif [ ${trainer} = "${to_static_key}" ]; then run_train=${norm_trainer} run_export=${norm_export} set_to_static=${to_static_trainer} - elif [ ${trainer} = "${trainer_key2}" ]; then - run_train=${trainer_value2} - run_export=${export_value2} else continue fi