From 23e652fcf305cdcb46a3d975f81fab8b2fb310a9 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Wed, 19 Jan 2022 06:40:26 +0000 Subject: [PATCH] add extra params --- .../configs/det_mv3_db_v2.0/train_benchmark.txt | 2 +- test_tipc/test_train_inference_python.sh | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt b/test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt index da0050b7..7942c7cf 100644 --- a/test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt +++ b/test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt @@ -13,7 +13,7 @@ train_infer_img_dir:null null:null ## trainer:norm_train -norm_train:tools/train.py -c configs/det/det_mv3_db.yml --profiler_options="batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile" -o Global.pretrained_model=./pretrain_models/MobileNetV3_large_x0_5_pretrained +norm_train:tools/train.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model=./pretrain_models/MobileNetV3_large_x0_5_pretrained pact_train:null fpgm_train:null distill_train:null diff --git a/test_tipc/test_train_inference_python.sh b/test_tipc/test_train_inference_python.sh index 9bde89d7..c9ca2d50 100644 --- a/test_tipc/test_train_inference_python.sh +++ b/test_tipc/test_train_inference_python.sh @@ -5,6 +5,12 @@ FILENAME=$1 # MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer', 'whole_infer', 'klquant_whole_infer'] MODE=$2 +if [ $# -eq 3 ] ; then + extra_train_params=$3 +else + extra_train_params="" +fi + dataline=$(awk 'NR==1, NR==51{print}' $FILENAME) # parser params @@ -330,14 +336,14 @@ else set_save_model=$(func_set_params "${save_model_key}" "${save_log}") if [ ${#gpu} -le 2 ];then # train with cpu or single gpu - cmd="${python} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_autocast} ${set_batchsize} ${set_train_params1} ${set_amp_config} " + cmd="${python} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_autocast} ${set_batchsize} ${set_train_params1} ${set_amp_config} ${extra_train_params}" elif [ ${#ips} -le 26 ];then # train with multi-gpu - cmd="${python} -m paddle.distributed.launch --gpus=${gpu} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_autocast} ${set_batchsize} ${set_train_params1} ${set_amp_config}" + cmd="${python} -m paddle.distributed.launch --gpus=${gpu} ${run_train} ${set_use_gpu} ${set_save_model} ${set_epoch} ${set_pretrain} ${set_autocast} ${set_batchsize} ${set_train_params1} ${set_amp_config} ${extra_train_params}" else # train with multi-machine - cmd="${python} -m paddle.distributed.launch --ips=${ips} --gpus=${gpu} ${run_train} ${set_use_gpu} ${set_save_model} ${set_pretrain} ${set_epoch} ${set_autocast} ${set_batchsize} ${set_train_params1} ${set_amp_config}" + cmd="${python} -m paddle.distributed.launch --ips=${ips} --gpus=${gpu} ${run_train} ${set_use_gpu} ${set_save_model} ${set_pretrain} ${set_epoch} ${set_autocast} ${set_batchsize} ${set_train_params1} ${set_amp_config} ${extra_train_params}" fi # run train - eval $cmd + echo $cmd status_check $? "${cmd}" "${status_log}" set_eval_pretrain=$(func_set_params "${pretrain_model_key}" "${save_log}/${train_model_name}") -- GitLab