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
1a66977f
Unverified
Commit
1a66977f
authored
May 20, 2021
by
ritosonn
Committed by
GitHub
May 20, 2021
Browse files
[fix]: Fix a bug where logs are missing when two or more loggers were set (#1015)
* +super().before_run() * flip reset_flag
parent
b8c09f3b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
mmcv/runner/hooks/logger/mlflow.py
mmcv/runner/hooks/logger/mlflow.py
+2
-1
mmcv/runner/hooks/logger/pavi.py
mmcv/runner/hooks/logger/pavi.py
+2
-1
mmcv/runner/hooks/logger/tensorboard.py
mmcv/runner/hooks/logger/tensorboard.py
+2
-1
mmcv/runner/hooks/logger/wandb.py
mmcv/runner/hooks/logger/wandb.py
+2
-1
No files found.
mmcv/runner/hooks/logger/mlflow.py
View file @
1a66977f
...
@@ -13,7 +13,7 @@ class MlflowLoggerHook(LoggerHook):
...
@@ -13,7 +13,7 @@ class MlflowLoggerHook(LoggerHook):
log_model
=
True
,
log_model
=
True
,
interval
=
10
,
interval
=
10
,
ignore_last
=
True
,
ignore_last
=
True
,
reset_flag
=
Tru
e
,
reset_flag
=
Fals
e
,
by_epoch
=
True
):
by_epoch
=
True
):
"""Class to log metrics and (optionally) a trained model to MLflow.
"""Class to log metrics and (optionally) a trained model to MLflow.
...
@@ -60,6 +60,7 @@ class MlflowLoggerHook(LoggerHook):
...
@@ -60,6 +60,7 @@ class MlflowLoggerHook(LoggerHook):
@
master_only
@
master_only
def
before_run
(
self
,
runner
):
def
before_run
(
self
,
runner
):
super
(
MlflowLoggerHook
,
self
).
before_run
(
runner
)
if
self
.
exp_name
is
not
None
:
if
self
.
exp_name
is
not
None
:
self
.
mlflow
.
set_experiment
(
self
.
exp_name
)
self
.
mlflow
.
set_experiment
(
self
.
exp_name
)
if
self
.
tags
is
not
None
:
if
self
.
tags
is
not
None
:
...
...
mmcv/runner/hooks/logger/pavi.py
View file @
1a66977f
...
@@ -22,7 +22,7 @@ class PaviLoggerHook(LoggerHook):
...
@@ -22,7 +22,7 @@ class PaviLoggerHook(LoggerHook):
add_last_ckpt
=
False
,
add_last_ckpt
=
False
,
interval
=
10
,
interval
=
10
,
ignore_last
=
True
,
ignore_last
=
True
,
reset_flag
=
Tru
e
,
reset_flag
=
Fals
e
,
by_epoch
=
True
,
by_epoch
=
True
,
img_key
=
'img_info'
):
img_key
=
'img_info'
):
super
(
PaviLoggerHook
,
self
).
__init__
(
interval
,
ignore_last
,
reset_flag
,
super
(
PaviLoggerHook
,
self
).
__init__
(
interval
,
ignore_last
,
reset_flag
,
...
@@ -34,6 +34,7 @@ class PaviLoggerHook(LoggerHook):
...
@@ -34,6 +34,7 @@ class PaviLoggerHook(LoggerHook):
@
master_only
@
master_only
def
before_run
(
self
,
runner
):
def
before_run
(
self
,
runner
):
super
(
PaviLoggerHook
,
self
).
before_run
(
runner
)
try
:
try
:
from
pavi
import
SummaryWriter
from
pavi
import
SummaryWriter
except
ImportError
:
except
ImportError
:
...
...
mmcv/runner/hooks/logger/tensorboard.py
View file @
1a66977f
...
@@ -14,7 +14,7 @@ class TensorboardLoggerHook(LoggerHook):
...
@@ -14,7 +14,7 @@ class TensorboardLoggerHook(LoggerHook):
log_dir
=
None
,
log_dir
=
None
,
interval
=
10
,
interval
=
10
,
ignore_last
=
True
,
ignore_last
=
True
,
reset_flag
=
Tru
e
,
reset_flag
=
Fals
e
,
by_epoch
=
True
):
by_epoch
=
True
):
super
(
TensorboardLoggerHook
,
self
).
__init__
(
interval
,
ignore_last
,
super
(
TensorboardLoggerHook
,
self
).
__init__
(
interval
,
ignore_last
,
reset_flag
,
by_epoch
)
reset_flag
,
by_epoch
)
...
@@ -22,6 +22,7 @@ class TensorboardLoggerHook(LoggerHook):
...
@@ -22,6 +22,7 @@ class TensorboardLoggerHook(LoggerHook):
@
master_only
@
master_only
def
before_run
(
self
,
runner
):
def
before_run
(
self
,
runner
):
super
(
TensorboardLoggerHook
,
self
).
before_run
(
runner
)
if
TORCH_VERSION
<
'1.1'
or
TORCH_VERSION
==
'parrots'
:
if
TORCH_VERSION
<
'1.1'
or
TORCH_VERSION
==
'parrots'
:
try
:
try
:
from
tensorboardX
import
SummaryWriter
from
tensorboardX
import
SummaryWriter
...
...
mmcv/runner/hooks/logger/wandb.py
View file @
1a66977f
...
@@ -11,7 +11,7 @@ class WandbLoggerHook(LoggerHook):
...
@@ -11,7 +11,7 @@ class WandbLoggerHook(LoggerHook):
init_kwargs
=
None
,
init_kwargs
=
None
,
interval
=
10
,
interval
=
10
,
ignore_last
=
True
,
ignore_last
=
True
,
reset_flag
=
Tru
e
,
reset_flag
=
Fals
e
,
commit
=
True
,
commit
=
True
,
by_epoch
=
True
,
by_epoch
=
True
,
with_step
=
True
):
with_step
=
True
):
...
@@ -32,6 +32,7 @@ class WandbLoggerHook(LoggerHook):
...
@@ -32,6 +32,7 @@ class WandbLoggerHook(LoggerHook):
@
master_only
@
master_only
def
before_run
(
self
,
runner
):
def
before_run
(
self
,
runner
):
super
(
WandbLoggerHook
,
self
).
before_run
(
runner
)
if
self
.
wandb
is
None
:
if
self
.
wandb
is
None
:
self
.
import_wandb
()
self
.
import_wandb
()
if
self
.
init_kwargs
:
if
self
.
init_kwargs
:
...
...
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