未验证 提交 1333ab1b 编写于 作者: W WangZhen 提交者: GitHub

[TIPC]Polish tipc shell for dy2st (#7381)

* Polish tipc shell for dy2st

* Add dynamicTostatic check

* Fix shell
上级 04db2d53
...@@ -88,7 +88,7 @@ lines=(${dataline}) ...@@ -88,7 +88,7 @@ lines=(${dataline})
model_name=$(func_parser_value "${lines[1]}") model_name=$(func_parser_value "${lines[1]}")
# 获取benchmark_params所在的行数 # 获取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 # for train log parser
batch_size=$(func_parser_value "${lines[line_num]}") batch_size=$(func_parser_value "${lines[line_num]}")
line_num=`expr $line_num + 1` line_num=`expr $line_num + 1`
...@@ -144,6 +144,14 @@ if [ ! -n "$PARAMS" ] ;then ...@@ -144,6 +144,14 @@ if [ ! -n "$PARAMS" ] ;then
device_num="N1C4" device_num="N1C4"
device_num_list=($device_num) device_num_list=($device_num)
run_mode="DP" 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 else
# parser params from input: modeltype_bs${bs_item}_${fp_item}_${run_mode}_${device_num} # parser params from input: modeltype_bs${bs_item}_${fp_item}_${run_mode}_${device_num}
IFS="_" IFS="_"
......
...@@ -17,7 +17,7 @@ norm_train:tools/train.py -c configs/yolov3/yolov3_darknet53_270e_coco.yml -o wo ...@@ -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 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 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 distill_train:null
to_static_train:--to_static null:null
null:null null:null
## ##
===========================eval_params=========================== ===========================eval_params===========================
...@@ -57,4 +57,6 @@ repeat:3 ...@@ -57,4 +57,6 @@ repeat:3
--profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile --profiler_options:batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile
flags:null flags:null
===========================infer_benchmark_params=========================== ===========================infer_benchmark_params===========================
numpy_infer_input:3x608x608.npy numpy_infer_input:3x608x608.npy
\ No newline at end of file ===========================to_static_train_benchmark_params===========================
to_static_train:--to_static
\ No newline at end of file
...@@ -41,8 +41,8 @@ fpgm_key=$(func_parser_key "${lines[17]}") ...@@ -41,8 +41,8 @@ fpgm_key=$(func_parser_key "${lines[17]}")
fpgm_trainer=$(func_parser_value "${lines[17]}") fpgm_trainer=$(func_parser_value "${lines[17]}")
distill_key=$(func_parser_key "${lines[18]}") distill_key=$(func_parser_key "${lines[18]}")
distill_trainer=$(func_parser_value "${lines[18]}") distill_trainer=$(func_parser_value "${lines[18]}")
to_static_key=$(func_parser_key "${lines[19]}") trainer_key1=$(func_parser_key "${lines[19]}")
to_static_trainer=$(func_parser_value "${lines[19]}") trainer_value1=$(func_parser_value "${lines[19]}")
trainer_key2=$(func_parser_key "${lines[20]}") trainer_key2=$(func_parser_key "${lines[20]}")
trainer_value2=$(func_parser_value "${lines[20]}") trainer_value2=$(func_parser_value "${lines[20]}")
...@@ -96,6 +96,9 @@ LOG_PATH="./test_tipc/output/${model_name}/${MODE}" ...@@ -96,6 +96,9 @@ LOG_PATH="./test_tipc/output/${model_name}/${MODE}"
mkdir -p ${LOG_PATH} mkdir -p ${LOG_PATH}
status_log="${LOG_PATH}/results_python.log" 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(){ function func_inference(){
IFS='|' IFS='|'
...@@ -251,13 +254,16 @@ else ...@@ -251,13 +254,16 @@ else
elif [ ${trainer} = "${distill_key}" ]; then elif [ ${trainer} = "${distill_key}" ]; then
run_train=${distill_trainer} run_train=${distill_trainer}
run_export=${distill_export} 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 elif [ ${trainer} = "${to_static_key}" ]; then
run_train=${norm_trainer} run_train=${norm_trainer}
run_export=${norm_export} run_export=${norm_export}
set_to_static=${to_static_trainer} set_to_static=${to_static_trainer}
elif [ ${trainer} = "${trainer_key2}" ]; then
run_train=${trainer_value2}
run_export=${export_value2}
else else
continue continue
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册