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
9e7dc2b8
Commit
9e7dc2b8
authored
Mar 24, 2021
by
littletomatodonkey
Browse files
fix logger info for empty log
parent
311d1a10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
tools/program.py
tools/program.py
+3
-2
tools/train.py
tools/train.py
+4
-1
No files found.
tools/program.py
View file @
9e7dc2b8
...
@@ -237,8 +237,9 @@ def train(config,
...
@@ -237,8 +237,9 @@ def train(config,
vdl_writer
.
add_scalar
(
'TRAIN/{}'
.
format
(
k
),
v
,
global_step
)
vdl_writer
.
add_scalar
(
'TRAIN/{}'
.
format
(
k
),
v
,
global_step
)
vdl_writer
.
add_scalar
(
'TRAIN/lr'
,
lr
,
global_step
)
vdl_writer
.
add_scalar
(
'TRAIN/lr'
,
lr
,
global_step
)
if
dist
.
get_rank
(
if
dist
.
get_rank
()
==
0
and
(
)
==
0
and
global_step
>
0
and
global_step
%
print_batch_step
==
0
:
(
global_step
>
0
and
global_step
%
print_batch_step
==
0
)
or
(
idx
>=
len
(
train_dataloader
)
-
1
)):
logs
=
train_stats
.
log
()
logs
=
train_stats
.
log
()
strs
=
'epoch: [{}/{}], iter: {}, {}, reader_cost: {:.5f} s, batch_cost: {:.5f} s, samples: {}, ips: {:.5f}'
.
format
(
strs
=
'epoch: [{}/{}], iter: {}, {}, reader_cost: {:.5f} s, batch_cost: {:.5f} s, samples: {}, ips: {:.5f}'
.
format
(
epoch
,
epoch_num
,
global_step
,
logs
,
train_reader_cost
/
epoch
,
epoch_num
,
global_step
,
logs
,
train_reader_cost
/
...
...
tools/train.py
View file @
9e7dc2b8
...
@@ -52,7 +52,10 @@ def main(config, device, logger, vdl_writer):
...
@@ -52,7 +52,10 @@ def main(config, device, logger, vdl_writer):
train_dataloader
=
build_dataloader
(
config
,
'Train'
,
device
,
logger
)
train_dataloader
=
build_dataloader
(
config
,
'Train'
,
device
,
logger
)
if
len
(
train_dataloader
)
==
0
:
if
len
(
train_dataloader
)
==
0
:
logger
.
error
(
logger
.
error
(
'No Images in train dataset, please check annotation file and path in the configuration file'
"No Images in train dataset, please ensure
\n
"
+
"
\t
1. The images num in the train label_file_list should be larger than or equal with batch size.
\n
"
+
"
\t
2. The annotation file and path in the configuration file are provided normally."
)
)
return
return
...
...
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