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
eae14cab
Commit
eae14cab
authored
Apr 15, 2022
by
Manan Goel
Browse files
Fixed bug tto check if log_writer is not None before calling log_model
parent
f1610456
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
tools/program.py
tools/program.py
+4
-3
No files found.
tools/program.py
View file @
eae14cab
...
@@ -380,7 +380,8 @@ def train(config,
...
@@ -380,7 +380,8 @@ def train(config,
epoch
=
epoch
,
epoch
=
epoch
,
global_step
=
global_step
)
global_step
=
global_step
)
log_writer
.
log_model
(
is_best
=
False
,
prefix
=
"latest"
)
if
log_writer
is
not
None
:
log_writer
.
log_model
(
is_best
=
False
,
prefix
=
"latest"
)
if
dist
.
get_rank
()
==
0
and
epoch
>
0
and
epoch
%
save_epoch_step
==
0
:
if
dist
.
get_rank
()
==
0
and
epoch
>
0
and
epoch
%
save_epoch_step
==
0
:
save_model
(
save_model
(
...
@@ -394,8 +395,8 @@ def train(config,
...
@@ -394,8 +395,8 @@ def train(config,
best_model_dict
=
best_model_dict
,
best_model_dict
=
best_model_dict
,
epoch
=
epoch
,
epoch
=
epoch
,
global_step
=
global_step
)
global_step
=
global_step
)
if
log_writer
is
not
None
:
log_writer
.
log_model
(
is_best
=
False
,
prefix
=
'iter_epoch_{}'
.
format
(
epoch
))
log_writer
.
log_model
(
is_best
=
False
,
prefix
=
'iter_epoch_{}'
.
format
(
epoch
))
best_str
=
'best metric, {}'
.
format
(
', '
.
join
(
best_str
=
'best metric, {}'
.
format
(
', '
.
join
(
[
'{}: {}'
.
format
(
k
,
v
)
for
k
,
v
in
best_model_dict
.
items
()]))
[
'{}: {}'
.
format
(
k
,
v
)
for
k
,
v
in
best_model_dict
.
items
()]))
...
...
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