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
0b8acd2b
Unverified
Commit
0b8acd2b
authored
Oct 29, 2020
by
Wang Xinjiang
Committed by
GitHub
Oct 29, 2020
Browse files
Use config_file to get config dict in PaviLogger (#630)
* Add 'config' keyword in meta for pavi logger * Use config file
parent
f4de390b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
mmcv/runner/hooks/logger/pavi.py
mmcv/runner/hooks/logger/pavi.py
+23
-10
No files found.
mmcv/runner/hooks/logger/pavi.py
View file @
0b8acd2b
...
...
@@ -41,12 +41,25 @@ class PaviLoggerHook(LoggerHook):
self
.
init_kwargs
=
dict
()
self
.
init_kwargs
[
'task'
]
=
self
.
run_name
self
.
init_kwargs
[
'model'
]
=
runner
.
_model_name
if
runner
.
meta
is
not
None
and
'config_dict'
in
runner
.
meta
:
config_dict
=
runner
.
meta
[
'config_dict'
].
copy
()
if
runner
.
meta
is
not
None
:
if
'config_dict'
in
runner
.
meta
:
config_dict
=
runner
.
meta
[
'config_dict'
]
assert
isinstance
(
config_dict
,
dict
),
(
'meta["config_dict"] has to be of a dict, '
f
'but got
{
type
(
config_dict
)
}
'
)
elif
'config_file'
in
runner
.
meta
:
config_file
=
runner
.
meta
[
'config_file'
]
config_dict
=
dict
(
mmcv
.
Config
.
fromfile
(
config_file
))
else
:
config_dict
=
None
if
config_dict
is
not
None
:
# 'max_.*iter' is parsed in pavi sdk as the maximum iterations
# to properly set up the progress bar.
config_dict
=
config_dict
.
copy
()
config_dict
.
setdefault
(
'max_iter'
,
runner
.
max_iters
)
# non-serializable values are first converted in mmcv.dump to json
# non-serializable values are first converted in
# mmcv.dump to json
config_dict
=
json
.
loads
(
mmcv
.
dump
(
config_dict
,
file_format
=
'json'
))
session_text
=
yaml
.
dump
(
config_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