提交 35ee32e3 编写于 作者: 奔跑的蜗牛hhhhh's avatar 奔跑的蜗牛hhhhh

fix_scipts

上级 478a019d
...@@ -7,7 +7,7 @@ function _set_params(){ ...@@ -7,7 +7,7 @@ function _set_params(){
batch_size=${2:-"64"} batch_size=${2:-"64"}
fp_item=${3:-"fp32"} # fp32|fp16 fp_item=${3:-"fp32"} # fp32|fp16
epochs=${4:-"2"} # 可选,如果需要修改代码提前中断 epochs=${4:-"2"} # 可选,如果需要修改代码提前中断
model_name=${5:-"model_name"} model_item=${5:-"model_item"}
run_log_path=${TRAIN_LOG_DIR:-$(pwd)} # TRAIN_LOG_DIR 后续QA设置该参数 run_log_path=${TRAIN_LOG_DIR:-$(pwd)} # TRAIN_LOG_DIR 后续QA设置该参数
index=1 index=1
...@@ -23,16 +23,17 @@ function _set_params(){ ...@@ -23,16 +23,17 @@ function _set_params(){
device=${CUDA_VISIBLE_DEVICES//,/ } device=${CUDA_VISIBLE_DEVICES//,/ }
arr=(${device}) arr=(${device})
num_gpu_devices=${#arr[*]} num_gpu_devices=${#arr[*]}
log_file=${run_log_path}/clas_${model_name}_${run_mode}_bs${batch_size}_${fp_item}_${num_gpu_devices} log_file=${run_log_path}/clas_${model_item}_${run_mode}_bs${batch_size}_${fp_item}_${num_gpu_devices}
model_name=${model_item}_bs${batch_size}_${fp_item} # model_item 用于yml匹配,model_name用于入库
} }
function _train(){ function _train(){
echo "Train on ${num_gpu_devices} GPUs" echo "Train on ${num_gpu_devices} GPUs"
echo "current CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES, gpus=$num_gpu_devices, batch_size=$batch_size" echo "current CUDA_VISIBLE_DEVICES=$CUDA_VISIBLE_DEVICES, gpus=$num_gpu_devices, batch_size=$batch_size"
if [ ${fp_item} = "fp32" ];then if [ ${fp_item} = "fp32" ];then
model_config=`find ppcls/configs/ImageNet -name ${model_name}.yaml` model_config=`find ppcls/configs/ImageNet -name ${model_item}.yaml`
else else
model_config=`find ppcls/configs/ImageNet -name ${model_name}_fp16.yaml` model_config=`find ppcls/configs/ImageNet -name ${model_item}_fp16.yaml`
fi fi
train_cmd="-c ${model_config} -o DataLoader.Train.sampler.batch_size=${batch_size} -o Global.epochs=${epochs} -o Global.eval_during_train=False -o Global.print_batch_step=2" train_cmd="-c ${model_config} -o DataLoader.Train.sampler.batch_size=${batch_size} -o Global.epochs=${epochs} -o Global.eval_during_train=False -o Global.print_batch_step=2"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册