Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
19c5ab23
Commit
19c5ab23
authored
Jan 20, 2022
by
LDOUBLEV
Browse files
delete extra params and set profile_option as bool
parent
d62b3d8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt
test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt
+1
-1
test_tipc/test_train_inference_python.sh
test_tipc/test_train_inference_python.sh
+3
-9
tools/program.py
tools/program.py
+6
-2
No files found.
test_tipc/configs/det_mv3_db_v2.0/train_benchmark.txt
View file @
19c5ab23
...
@@ -10,7 +10,7 @@ Train.loader.batch_size_per_card:benchmark_train=16
...
@@ -10,7 +10,7 @@ Train.loader.batch_size_per_card:benchmark_train=16
Global.pretrained_model:null
Global.pretrained_model:null
train_model_name:latest
train_model_name:latest
train_infer_img_dir:null
train_infer_img_dir:null
null:null
--profiler_options:True
##
##
trainer:norm_train
trainer:norm_train
norm_train:tools/train.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model=./pretrain_models/MobileNetV3_large_x0_5_pretrained
norm_train:tools/train.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model=./pretrain_models/MobileNetV3_large_x0_5_pretrained
...
...
test_tipc/test_train_inference_python.sh
View file @
19c5ab23
...
@@ -5,12 +5,6 @@ FILENAME=$1
...
@@ -5,12 +5,6 @@ FILENAME=$1
# MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer', 'whole_infer', 'klquant_whole_infer']
# MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer', 'whole_infer', 'klquant_whole_infer']
MODE
=
$2
MODE
=
$2
if
[
$#
-eq
3
]
;
then
extra_train_params
=
$3
else
extra_train_params
=
""
fi
dataline
=
$(
awk
'NR==1, NR==51{print}'
$FILENAME
)
dataline
=
$(
awk
'NR==1, NR==51{print}'
$FILENAME
)
# parser params
# parser params
...
@@ -336,11 +330,11 @@ else
...
@@ -336,11 +330,11 @@ else
set_save_model
=
$(
func_set_params
"
${
save_model_key
}
"
"
${
save_log
}
"
)
set_save_model
=
$(
func_set_params
"
${
save_model_key
}
"
"
${
save_log
}
"
)
if
[
${#
gpu
}
-le
2
]
;
then
# train with cpu or single gpu
if
[
${#
gpu
}
-le
2
]
;
then
# train with cpu or single gpu
cmd
=
"
${
python
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_epoch
}
${
set_pretrain
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
${
extra_train_params
}
"
cmd
=
"
${
python
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_epoch
}
${
set_pretrain
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
elif
[
${#
ips
}
-le
26
]
;
then
# train with multi-gpu
elif
[
${#
ips
}
-le
26
]
;
then
# train with multi-gpu
cmd
=
"
${
python
}
-m paddle.distributed.launch --gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_epoch
}
${
set_pretrain
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
${
extra_train_params
}
"
cmd
=
"
${
python
}
-m paddle.distributed.launch --gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_epoch
}
${
set_pretrain
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
else
# train with multi-machine
else
# train with multi-machine
cmd
=
"
${
python
}
-m paddle.distributed.launch --ips=
${
ips
}
--gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_pretrain
}
${
set_epoch
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
${
extra_train_params
}
"
cmd
=
"
${
python
}
-m paddle.distributed.launch --ips=
${
ips
}
--gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_pretrain
}
${
set_epoch
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
fi
fi
# run train
# run train
eval
$cmd
eval
$cmd
...
...
tools/program.py
View file @
19c5ab23
...
@@ -46,8 +46,8 @@ class ArgsParser(ArgumentParser):
...
@@ -46,8 +46,8 @@ class ArgsParser(ArgumentParser):
self
.
add_argument
(
self
.
add_argument
(
'-p'
,
'-p'
,
'--profiler_options'
,
'--profiler_options'
,
type
=
str
,
type
=
bool
,
default
=
Non
e
,
default
=
Fals
e
,
help
=
'The option of profiler, which should be in format
\"
key1=value1;key2=value2;key3=value3
\"
.'
help
=
'The option of profiler, which should be in format
\"
key1=value1;key2=value2;key3=value3
\"
.'
)
)
...
@@ -150,6 +150,10 @@ def train(config,
...
@@ -150,6 +150,10 @@ def train(config,
print_batch_step
=
config
[
'Global'
][
'print_batch_step'
]
print_batch_step
=
config
[
'Global'
][
'print_batch_step'
]
eval_batch_step
=
config
[
'Global'
][
'eval_batch_step'
]
eval_batch_step
=
config
[
'Global'
][
'eval_batch_step'
]
profiler_options
=
config
[
'profiler_options'
]
profiler_options
=
config
[
'profiler_options'
]
if
profiler_options
is
True
:
profiler_options
=
"batch_range=[10,20];state=GPU;tracer_option=Default;profile_path=model.profile"
else
:
profiler_options
=
None
global_step
=
0
global_step
=
0
if
'global_step'
in
pre_best_model_dict
:
if
'global_step'
in
pre_best_model_dict
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment