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
OpenDAS
OpenPCDet
Commits
e94c91d3
Unverified
Commit
e94c91d3
authored
Dec 06, 2021
by
jihan.yang
Committed by
GitHub
Dec 06, 2021
Browse files
refix disp_dict when distributed (#700)
parent
65554a52
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
tools/train_utils/train_utils.py
tools/train_utils/train_utils.py
+5
-8
No files found.
tools/train_utils/train_utils.py
View file @
e94c91d3
...
@@ -61,19 +61,16 @@ def train_one_epoch(model, optimizer, train_loader, model_func, lr_scheduler, ac
...
@@ -61,19 +61,16 @@ def train_one_epoch(model, optimizer, train_loader, model_func, lr_scheduler, ac
avg_forward_time
=
commu_utils
.
average_reduce_value
(
cur_forward_time
)
avg_forward_time
=
commu_utils
.
average_reduce_value
(
cur_forward_time
)
avg_batch_time
=
commu_utils
.
average_reduce_value
(
cur_batch_time
)
avg_batch_time
=
commu_utils
.
average_reduce_value
(
cur_batch_time
)
# log to console and tensorboard
if
rank
==
0
:
if
rank
==
0
:
data_time
.
update
(
avg_data_time
)
data_time
.
update
(
avg_data_time
)
forward_time
.
update
(
avg_forward_time
)
forward_time
.
update
(
avg_forward_time
)
batch_time
.
update
(
avg_batch_time
)
batch_time
.
update
(
avg_batch_time
)
disp_dict
.
update
({
'loss'
:
loss
.
item
(),
'lr'
:
cur_lr
,
'd_time'
:
f
'
{
data_time
.
val
:.
2
f
}
(
{
data_time
.
avg
:.
2
f
}
)'
,
'f_time'
:
f
'
{
forward_time
.
val
:.
2
f
}
(
{
forward_time
.
avg
:.
2
f
}
)'
,
'b_time'
:
f
'
{
batch_time
.
val
:.
2
f
}
(
{
batch_time
.
avg
:.
2
f
}
)'
})
disp_dict
.
update
({
'loss'
:
loss
.
item
(),
'lr'
:
cur_lr
,
'd_time'
:
f
'
{
data_time
.
val
:.
2
f
}
(
{
data_time
.
avg
:.
2
f
}
)'
,
'f_time'
:
f
'
{
forward_time
.
val
:.
2
f
}
(
{
forward_time
.
avg
:.
2
f
}
)'
,
'b_time'
:
f
'
{
batch_time
.
val
:.
2
f
}
(
{
batch_time
.
avg
:.
2
f
}
)'
})
# log to console and tensorboard
if
rank
==
0
:
pbar
.
update
()
pbar
.
update
()
pbar
.
set_postfix
(
dict
(
total_it
=
accumulated_iter
))
pbar
.
set_postfix
(
dict
(
total_it
=
accumulated_iter
))
tbar
.
set_postfix
(
disp_dict
)
tbar
.
set_postfix
(
disp_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