Skip to content

Commit

Permalink
update seg benchmark case (PaddlePaddle#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmglove authored Nov 8, 2021
1 parent 11d7807 commit aa1c7d1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions benchmark/run_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function _set_params(){
batch_size=${2:-"2"}
fp_item=${3:-"fp32"} # fp32 or fp16
max_iter=${4:-"100"}
model_name=${5:-"model_name"}
model_item=${5:-"model_item"} # fastscnn|segformer_b0| ocrnet_hrnetw48
num_workers=${6:-"3"}
run_log_path=${TRAIN_LOG_DIR:-$(pwd)}
base_batch_size=${batch_size}
Expand All @@ -21,11 +21,12 @@ function _set_params(){
keyword="ips:" # 解析日志,筛选出数据所在行的关键字 (必填)
keyword_loss="loss:" #选填
index="1"
model_name=${model_item}_bs${batch_size}_${fp_item} # 模型的不同bs、fp配置模型应不一样,避免入库会混乱

device=${CUDA_VISIBLE_DEVICES//,/ }
arr=(${device})
num_gpu_devices=${#arr[*]}
log_file=${run_log_path}/${model_name}_${run_mode}_bs${batch_size}_${fp_item}_${num_gpu_devices}
log_file=${run_log_path}/${model_item}_${run_mode}_bs${batch_size}_${fp_item}_${num_gpu_devices}
}

function _train(){
Expand All @@ -35,7 +36,7 @@ function _train(){
if [ $fp_item = "fp16" ]; then
use_fp16_cmd="--fp16"
fi
train_cmd="--config=benchmark/configs/${model_name}.yml \
train_cmd="--config=benchmark/configs/${model_item}.yml \
--batch_size=${batch_size} \
--iters=${max_iter} \
--num_workers=${num_workers} ${use_fp16_cmd}"
Expand Down

0 comments on commit aa1c7d1

Please sign in to comment.