未验证 提交 6bf1b443 编写于 作者: F Feng Ni 提交者: GitHub

[benchmark] add jde/fairmot model training benchmark (#4307)

上级 e14387f8
......@@ -33,7 +33,7 @@ bash benchmark/run_all.sh
### 运行指定模型
* Usage:bash run_benchmark.sh ${run_mode} ${batch_size} ${fp_item} ${max_epoch} ${model_name}
* model_name: faster_rcnn, fcos, deformable_detr, gfl
* model_name: faster_rcnn, fcos, deformable_detr, gfl, hrnet, higherhrnet, solov2, jde, fairmot
```
git clone https://github.com/PaddlePaddle/PaddleDetection.git
cd PaddleDetection
......@@ -42,5 +42,5 @@ bash benchmark/prepare.sh
# 单卡
CUDA_VISIBLE_DEVICES=0 bash benchmark/run_benchmark.sh sp 2 fp32 1 faster_rcnn
# 多卡
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash run_benchmark.sh mp 2 fp32 1 faster_rcnn
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash benchmark/run_benchmark.sh mp 2 fp32 1 faster_rcnn
```
......@@ -2,8 +2,15 @@
pip3.7 install -U pip Cython
pip3.7 install -r requirements.txt
mv ./dataset/coco/download_coco.py . && rm -rf ./dataset/coco/* && mv ./download_coco.py ./dataset/coco/
# prepare lite train data
wget -nc -P ./dataset/coco/ https://paddledet.bj.bcebos.com/data/coco_benchmark.tar
cd ./dataset/coco/ && tar -xvf coco_benchmark.tar && mv -u coco_benchmark/* .
rm -rf coco_benchmark/
rm -rf ./dataset/mot/*
# prepare mot mini train data
wget -nc -P ./dataset/mot/ https://paddledet.bj.bcebos.com/data/mot_benchmark.tar
cd ./dataset/mot/ && tar -xvf mot_benchmark.tar && mv -u mot_benchmark/* .
rm -rf mot_benchmark/
......@@ -8,7 +8,7 @@
# run prepare.sh
bash benchmark/prepare.sh
model_name_list=(faster_rcnn fcos deformable_detr gfl)
model_name_list=(faster_rcnn fcos deformable_detr gfl hrnet higherhrnet solov2 jde fairmot)
fp_item_list=(fp32)
max_epoch=1
......@@ -22,6 +22,8 @@ for model_name in ${model_name_list[@]}; do
hrnet) bs_list=(64 160) ;;
higherhrnet) bs_list=(20 24) ;;
solov2) bs_list=(2 4) ;;
jde) bs_list=(4 14) ;;
fairmot) bs_list=(6 22) ;;
*) echo "wrong model_name"; exit 1;
esac
for bs_item in ${bs_list[@]}
......@@ -29,7 +31,7 @@ for model_name in ${model_name_list[@]}; do
echo "index is speed, 1gpus, begin, ${model_name}"
run_mode=sp
CUDA_VISIBLE_DEVICES=0 bash benchmark/run_benchmark.sh ${run_mode} ${bs_item} \
${fp_item} ${max_epoch} ${model_name} # (5min)
${fp_item} ${max_epoch} ${model_name}
sleep 60
echo "index is speed, 8gpus, run_mode is multi_process, begin, ${model_name}"
......
#!/usr/bin/env bash
set -xe
# Usage:CUDA_VISIBLE_DEVICES=0 bash run_benchmark.sh ${run_mode} ${batch_size} ${fp_item} ${max_epoch} ${model_name}
# Usage:CUDA_VISIBLE_DEVICES=0 bash benchmark/run_benchmark.sh ${run_mode} ${batch_size} ${fp_item} ${max_epoch} ${model_name}
python="python3.7"
# Parameter description
function _set_params(){
run_mode=${1:-"sp"} # sp|mp
batch_size=${2:-"2"} #
batch_size=${2:-"2"}
fp_item=${3:-"fp32"} # fp32|fp16
max_epoch=${4:-"1"} #
max_epoch=${4:-"1"}
model_name=${5:-"model_name"}
run_log_path=${TRAIN_LOG_DIR:-$(pwd)} # TRAIN_LOG_DIR
run_log_path=${TRAIN_LOG_DIR:-$(pwd)}
device=${CUDA_VISIBLE_DEVICES//,/ }
arr=(${device})
......@@ -29,6 +29,8 @@ function _train(){
hrnet) model_yml="configs/keypoint/hrnet/hrnet_w32_256x192.yml" ;;
higherhrnet) model_yml="configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512.yml" ;;
solov2) model_yml="configs/solov2/solov2_r50_fpn_1x_coco.yml" ;;
jde) model_yml="configs/mot/jde/jde_darknet53_30e_1088x608.yml" ;;
fairmot) model_yml="configs/mot/fairmot/fairmot_dla34_30e_1088x608.yml" ;;
*) echo "Undefined model_name"; exit 1;
esac
......@@ -50,7 +52,7 @@ function _train(){
log_parse_file="mylog/workerlog.0" ;;
*) echo "choose run_mode(sp or mp)"; exit 1;
esac
#
timeout 15m ${train_cmd} > ${log_file} 2>&1
if [ $? -ne 0 ];then
echo -e "${train_cmd}, FAIL"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册