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
MMCV
Commits
b74aa792
Unverified
Commit
b74aa792
authored
Nov 03, 2020
by
Wang Xinjiang
Committed by
GitHub
Nov 03, 2020
Browse files
Move mode str to the beginning (#634)
parent
2d52809c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
mmcv/runner/hooks/logger/base.py
mmcv/runner/hooks/logger/base.py
+4
-2
mmcv/runner/hooks/logger/pavi.py
mmcv/runner/hooks/logger/pavi.py
+1
-1
No files found.
mmcv/runner/hooks/logger/base.py
View file @
b74aa792
...
...
@@ -118,6 +118,7 @@ class LoggerHook(Hook):
runner
,
allow_scalar
=
True
,
allow_text
=
False
,
add_mode
=
True
,
tags_to_skip
=
(
'time'
,
'data_time'
)):
tags
=
{}
for
var
,
val
in
runner
.
log_buffer
.
output
.
items
():
...
...
@@ -127,8 +128,9 @@ class LoggerHook(Hook):
continue
if
isinstance
(
val
,
str
)
and
not
allow_text
:
continue
tag
=
f
'
{
var
}
/
{
self
.
get_mode
(
runner
)
}
'
tags
[
tag
]
=
val
if
add_mode
:
var
=
f
'
{
self
.
get_mode
(
runner
)
}
/
{
var
}
'
tags
[
var
]
=
val
tags
.
update
(
self
.
get_lr_tags
(
runner
))
tags
.
update
(
self
.
get_momentum_tags
(
runner
))
return
tags
...
...
mmcv/runner/hooks/logger/pavi.py
View file @
b74aa792
...
...
@@ -71,7 +71,7 @@ class PaviLoggerHook(LoggerHook):
@
master_only
def
log
(
self
,
runner
):
tags
=
self
.
get_loggable_tags
(
runner
)
tags
=
self
.
get_loggable_tags
(
runner
,
add_mode
=
False
)
if
tags
:
self
.
writer
.
add_scalars
(
self
.
get_mode
(
runner
),
tags
,
self
.
get_step
(
runner
))
...
...
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