Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
f744089c
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f744089c
编写于
2月 08, 2022
作者:
L
LDOUBLEV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
opt benchmark_trainv2.sh
上级
0269080a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
21 deletion
+30
-21
test_tipc/benchmark_trainv2.sh
test_tipc/benchmark_trainv2.sh
+26
-17
test_tipc/configs/det_mv3_db_v2/train_infer_python.txt
test_tipc/configs/det_mv3_db_v2/train_infer_python.txt
+1
-1
test_tipc/prepare.sh
test_tipc/prepare.sh
+3
-3
未找到文件。
test_tipc/benchmark_trainv2.sh
浏览文件 @
f744089c
...
...
@@ -2,7 +2,7 @@
source
test_tipc/common_func.sh
# set env
python
=
python
python
=
python
3.7
export
model_branch
=
`
git symbolic-ref HEAD 2>/dev/null |
cut
-d
"/"
-f
3
`
export
model_commit
=
$(
git log|head
-n1
|awk
'{print $2}'
)
export
str_tmp
=
$(
echo
`
pip list|grep paddlepaddle-gpu|awk
-F
' '
'{print $2}'
`
)
...
...
@@ -12,6 +12,8 @@ export frame_commit=$(echo `${python} -c "import paddle;print(paddle.version.com
# run benchmark sh
# Usage:
# bash run_benchmark_train.sh config.txt params
# or
# bash run_benchmark_train.sh config.txt
function
func_parser_params
(){
strs
=
$1
...
...
@@ -63,11 +65,11 @@ function get_repo_name(){
}
FILENAME
=
$1
cp
FILENAME as new FILENAME
# copy FILENAME as new
new_filename
=
"./test_tipc/benchmark_train.txt"
cmd
=
`
yes
|cp
$FILENAME
$new_filename
`
FILENAME
=
$new_filename
# MODE be one of ['benchmark_train']
# MODE
must
be one of ['benchmark_train']
MODE
=
$2
PARAMS
=
$3
# bash test_tipc/benchmark_train.sh test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt benchmark_train dynamic_bs8_null_SingleP_DP_N1C1
...
...
@@ -109,12 +111,19 @@ SAVE_LOG=${BENCHMARK_LOG_DIR:-$(pwd)} # */benchmark_log
mkdir
-p
"
${
SAVE_LOG
}
/benchmark_log/"
status_log
=
"
${
SAVE_LOG
}
/benchmark_log/results.log"
# set eval and export as null
# line eval_py: 24
# line export_py: 30
func_sed_params
"
$FILENAME
"
"24"
"null"
func_sed_params
"
$FILENAME
"
"30"
"null"
func_sed_params
"
$FILENAME
"
"3"
"
$python
"
# The number of lines in which train params can be replaced.
line_python
=
3
line_gpuid
=
4
line_precision
=
6
line_epoch
=
7
line_batchsize
=
9
line_profile
=
13
line_eval_py
=
24
line_export_py
=
30
func_sed_params
"
$FILENAME
"
"
${
line_eval_py
}
"
"null"
func_sed_params
"
$FILENAME
"
"
${
line_export_py
}
"
"null"
func_sed_params
"
$FILENAME
"
"
${
line_python
}
"
"
$python
"
# if params
if
[
!
-n
"
$PARAMS
"
]
;
then
...
...
@@ -151,9 +160,9 @@ for batch_size in ${batch_size_list[*]}; do
for
precision
in
${
fp_items_list
[*]
}
;
do
for
device_num
in
${
device_num_list
[*]
}
;
do
# sed batchsize and precision
func_sed_params
"
$FILENAME
"
"
6
"
"
$precision
"
func_sed_params
"
$FILENAME
"
"
9
"
"
$MODE
=
$batch_size
"
func_sed_params
"
$FILENAME
"
"
7
"
"
$MODE
=
$epoch
"
func_sed_params
"
$FILENAME
"
"
${
line_precision
}
"
"
$precision
"
func_sed_params
"
$FILENAME
"
"
${
line_batchsize
}
"
"
$MODE
=
$batch_size
"
func_sed_params
"
$FILENAME
"
"
${
line_epoch
}
"
"
$MODE
=
$epoch
"
gpu_id
=
$(
set_gpu_id
$device_num
)
if
[
${#
gpu_id
}
-le
1
]
;
then
...
...
@@ -161,9 +170,9 @@ for batch_size in ${batch_size_list[*]}; do
log_path
=
"
$SAVE_LOG
/profiling_log"
mkdir
-p
$log_path
log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_process_type
}
_
${
run_mode
}
_
${
device_num
}
_profiling"
func_sed_params
"
$FILENAME
"
"
4
"
"0"
# sed used gpu_id
func_sed_params
"
$FILENAME
"
"
${
line_gpuid
}
"
"0"
# sed used gpu_id
# set profile_option params
tmp
=
`
sed
-i
"
13
s/.*/
${
profile_option
}
/"
"
${
FILENAME
}
"
`
tmp
=
`
sed
-i
"
${
line_profile
}
s/.*/
${
profile_option
}
/"
"
${
FILENAME
}
"
`
# run test_train_inference_python.sh
cmd
=
"bash test_tipc/test_train_inference_python.sh
${
FILENAME
}
benchmark_train >
${
log_path
}
/
${
log_name
}
2>&1 "
...
...
@@ -178,7 +187,7 @@ for batch_size in ${batch_size_list[*]}; do
mkdir
-p
$speed_log_path
log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_process_type
}
_
${
run_mode
}
_
${
device_num
}
_log"
speed_log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_process_type
}
_
${
run_mode
}
_
${
device_num
}
_speed"
func_sed_params
"
$FILENAME
"
"
13
"
"null"
# sed profile_id as null
func_sed_params
"
$FILENAME
"
"
${
line_profile
}
"
"null"
# sed profile_id as null
cmd
=
"bash test_tipc/test_train_inference_python.sh
${
FILENAME
}
benchmark_train >
${
log_path
}
/
${
log_name
}
2>&1 "
echo
$cmd
job_bt
=
`
date
'+%Y%m%d%H%M%S'
`
...
...
@@ -215,8 +224,8 @@ for batch_size in ${batch_size_list[*]}; do
mkdir
-p
$speed_log_path
log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_process_type
}
_
${
run_mode
}
_
${
device_num
}
_log"
speed_log_name
=
"
${
repo_name
}
_
${
model_name
}
_bs
${
batch_size
}
_
${
precision
}
_
${
run_process_type
}
_
${
run_mode
}
_
${
device_num
}
_speed"
func_sed_params
"
$FILENAME
"
"
4
"
"
$gpu_id
"
# sed used gpu_id
func_sed_params
"
$FILENAME
"
"
13
"
"null"
# sed --profile_option as null
func_sed_params
"
$FILENAME
"
"
${
line_gpuid
}
"
"
$gpu_id
"
# sed used gpu_id
func_sed_params
"
$FILENAME
"
"
${
line_profile
}
"
"null"
# sed --profile_option as null
cmd
=
"bash test_tipc/test_train_inference_python.sh
${
FILENAME
}
benchmark_train >
${
log_path
}
/
${
log_name
}
2>&1 "
echo
$cmd
job_bt
=
`
date
'+%Y%m%d%H%M%S'
`
...
...
test_tipc/configs/det_mv3_db_v2/train_infer_python.txt
浏览文件 @
f744089c
===========================train_params===========================
model_name:det_mv3_db_v2
.
0
model_name:det_mv3_db_v2
_
0
python:python3.7
gpu_list:0|0,1
Global.use_gpu:True|True
...
...
test_tipc/prepare.sh
浏览文件 @
f744089c
...
...
@@ -22,7 +22,7 @@ trainer_list=$(func_parser_value "${lines[14]}")
if
[
${
MODE
}
=
"benchmark_train"
]
;
then
pip
install
-r
requirements.txt
if
[[
${
model_name
}
=
~
"det_mv3_db_v2"
]]
;
then
if
[[
${
model_name
}
=
~
"det_mv3_db_v2
_0
"
]]
;
then
rm
-rf
./train_data/icdar2015
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams
--no-check-certificate
wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015.tar
--no-check-certificate
...
...
@@ -61,7 +61,7 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/total_text_lite.tar
--no-check-certificate
cd
./train_data
&&
tar
xf total_text_lite.tar
&&
ln
-s
total_text_lite total_text
&&
cd
../
fi
if
[
${
model_name
}
==
"det_mv3_db_v2
.
0"
]
;
then
if
[
${
model_name
}
==
"det_mv3_db_v2
_
0"
]
;
then
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
--no-check-certificate
cd
./inference/
&&
tar
xf det_mv3_db_v2.0_train.tar
&&
cd
../
fi
...
...
@@ -220,7 +220,7 @@ elif [ ${MODE} = "whole_infer" ];then
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_sast_totaltext_v2.0_train.tar
--no-check-certificate
cd
./inference/
&&
tar
xf det_r50_vd_sast_totaltext_v2.0_train.tar
&&
cd
../
fi
if
[
${
model_name
}
==
"det_mv3_db_v2
.
0"
]
;
then
if
[
${
model_name
}
==
"det_mv3_db_v2
_
0"
]
;
then
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
--no-check-certificate
cd
./inference/
&&
tar
xf det_mv3_db_v2.0_train.tar
&&
tar
xf ch_det_data_50.tar
&&
cd
../
fi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录