Skip to content

Commit afb7399

Browse files
authoredSep 24, 2020
Add missing by_epoch arg (open-mmlab#576)
1 parent 50af009 commit afb7399

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed
 

‎mmcv/runner/hooks/logger/mlflow.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ def __init__(self,
1515
log_model=True,
1616
interval=10,
1717
ignore_last=True,
18-
reset_flag=True):
18+
reset_flag=True,
19+
by_epoch=True):
1920
"""Class to log metrics and (optionally) a trained model to MLflow.
2021
2122
It requires `MLflow`_ to be installed.
@@ -33,12 +34,17 @@ def __init__(self,
3334
Default True.
3435
If True, log runner.model as an MLflow artifact
3536
for the current run.
37+
interval (int): Logging interval (every k iterations).
38+
ignore_last (bool): Ignore the log of last iterations in each epoch
39+
if less than `interval`.
40+
reset_flag (bool): Whether to clear the output buffer after logging
41+
by_epoch (bool): Whether EpochBasedRunner is used.
3642
3743
.. _MLflow:
3844
https://www.mlflow.org/docs/latest/index.html
3945
"""
4046
super(MlflowLoggerHook, self).__init__(interval, ignore_last,
41-
reset_flag)
47+
reset_flag, by_epoch)
4248
self.import_mlflow()
4349
self.exp_name = exp_name
4450
self.tags = tags

‎mmcv/runner/hooks/logger/wandb.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ def __init__(self,
1313
init_kwargs=None,
1414
interval=10,
1515
ignore_last=True,
16-
reset_flag=True):
16+
reset_flag=True,
17+
by_epoch=True):
1718
super(WandbLoggerHook, self).__init__(interval, ignore_last,
18-
reset_flag)
19+
reset_flag, by_epoch)
1920
self.import_wandb()
2021
self.init_kwargs = init_kwargs
2122

0 commit comments

Comments
 (0)
Please sign in to comment.