Skip to content

Commit 6bf1b44

Browse files
authored
[benchmark] add jde/fairmot model training benchmark (PaddlePaddle#4307)
1 parent e14387f commit 6bf1b44

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

benchmark/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bash benchmark/run_all.sh
3333

3434
### 运行指定模型
3535
* Usage:bash run_benchmark.sh ${run_mode} ${batch_size} ${fp_item} ${max_epoch} ${model_name}
36-
* model_name: faster_rcnn, fcos, deformable_detr, gfl
36+
* model_name: faster_rcnn, fcos, deformable_detr, gfl, hrnet, higherhrnet, solov2, jde, fairmot
3737
```
3838
git clone https://github.com/PaddlePaddle/PaddleDetection.git
3939
cd PaddleDetection
@@ -42,5 +42,5 @@ bash benchmark/prepare.sh
4242
# 单卡
4343
CUDA_VISIBLE_DEVICES=0 bash benchmark/run_benchmark.sh sp 2 fp32 1 faster_rcnn
4444
# 多卡
45-
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash run_benchmark.sh mp 2 fp32 1 faster_rcnn
45+
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 bash benchmark/run_benchmark.sh mp 2 fp32 1 faster_rcnn
4646
```

benchmark/prepare.sh

+7
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@
22

33
pip3.7 install -U pip Cython
44
pip3.7 install -r requirements.txt
5+
56
mv ./dataset/coco/download_coco.py . && rm -rf ./dataset/coco/* && mv ./download_coco.py ./dataset/coco/
67
# prepare lite train data
78
wget -nc -P ./dataset/coco/ https://paddledet.bj.bcebos.com/data/coco_benchmark.tar
89
cd ./dataset/coco/ && tar -xvf coco_benchmark.tar && mv -u coco_benchmark/* .
910
rm -rf coco_benchmark/
11+
12+
rm -rf ./dataset/mot/*
13+
# prepare mot mini train data
14+
wget -nc -P ./dataset/mot/ https://paddledet.bj.bcebos.com/data/mot_benchmark.tar
15+
cd ./dataset/mot/ && tar -xvf mot_benchmark.tar && mv -u mot_benchmark/* .
16+
rm -rf mot_benchmark/

benchmark/run_all.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# run prepare.sh
99
bash benchmark/prepare.sh
1010

11-
model_name_list=(faster_rcnn fcos deformable_detr gfl)
11+
model_name_list=(faster_rcnn fcos deformable_detr gfl hrnet higherhrnet solov2 jde fairmot)
1212
fp_item_list=(fp32)
1313
max_epoch=1
1414

@@ -22,14 +22,16 @@ for model_name in ${model_name_list[@]}; do
2222
hrnet) bs_list=(64 160) ;;
2323
higherhrnet) bs_list=(20 24) ;;
2424
solov2) bs_list=(2 4) ;;
25+
jde) bs_list=(4 14) ;;
26+
fairmot) bs_list=(6 22) ;;
2527
*) echo "wrong model_name"; exit 1;
2628
esac
2729
for bs_item in ${bs_list[@]}
2830
do
2931
echo "index is speed, 1gpus, begin, ${model_name}"
3032
run_mode=sp
3133
CUDA_VISIBLE_DEVICES=0 bash benchmark/run_benchmark.sh ${run_mode} ${bs_item} \
32-
${fp_item} ${max_epoch} ${model_name} # (5min)
34+
${fp_item} ${max_epoch} ${model_name}
3335
sleep 60
3436

3537
echo "index is speed, 8gpus, run_mode is multi_process, begin, ${model_name}"

benchmark/run_benchmark.sh

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env bash
22
set -xe
3-
# Usage:CUDA_VISIBLE_DEVICES=0 bash run_benchmark.sh ${run_mode} ${batch_size} ${fp_item} ${max_epoch} ${model_name}
3+
# Usage:CUDA_VISIBLE_DEVICES=0 bash benchmark/run_benchmark.sh ${run_mode} ${batch_size} ${fp_item} ${max_epoch} ${model_name}
44
python="python3.7"
55
# Parameter description
66
function _set_params(){
77
run_mode=${1:-"sp"} # sp|mp
8-
batch_size=${2:-"2"} #
8+
batch_size=${2:-"2"}
99
fp_item=${3:-"fp32"} # fp32|fp16
10-
max_epoch=${4:-"1"} #
10+
max_epoch=${4:-"1"}
1111
model_name=${5:-"model_name"}
12-
run_log_path=${TRAIN_LOG_DIR:-$(pwd)} # TRAIN_LOG_DIR
12+
run_log_path=${TRAIN_LOG_DIR:-$(pwd)}
1313

1414
device=${CUDA_VISIBLE_DEVICES//,/ }
1515
arr=(${device})
@@ -29,6 +29,8 @@ function _train(){
2929
hrnet) model_yml="configs/keypoint/hrnet/hrnet_w32_256x192.yml" ;;
3030
higherhrnet) model_yml="configs/keypoint/higherhrnet/higherhrnet_hrnet_w32_512.yml" ;;
3131
solov2) model_yml="configs/solov2/solov2_r50_fpn_1x_coco.yml" ;;
32+
jde) model_yml="configs/mot/jde/jde_darknet53_30e_1088x608.yml" ;;
33+
fairmot) model_yml="configs/mot/fairmot/fairmot_dla34_30e_1088x608.yml" ;;
3234
*) echo "Undefined model_name"; exit 1;
3335
esac
3436

@@ -50,7 +52,7 @@ function _train(){
5052
log_parse_file="mylog/workerlog.0" ;;
5153
*) echo "choose run_mode(sp or mp)"; exit 1;
5254
esac
53-
#
55+
5456
timeout 15m ${train_cmd} > ${log_file} 2>&1
5557
if [ $? -ne 0 ];then
5658
echo -e "${train_cmd}, FAIL"

0 commit comments

Comments
 (0)