Skip to content

Commit

Permalink
Merge pull request #22 from MendelXu/main
Browse files Browse the repository at this point in the history
fix eval log bug
  • Loading branch information
MendelXu authored Sep 17, 2021
2 parents 9bde885 + 1a2473d commit bd17829
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion configs/baseline/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
log_config = dict(
interval=50,
hooks=[
dict(type="TextLoggerHook"),
dict(type="TextLoggerHook", by_epoch=False),
dict(
type="WandbLoggerHook",
init_kwargs=dict(
Expand Down
4 changes: 2 additions & 2 deletions configs/soft_teacher/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
custom_hooks = [
dict(type="NumClassCheckHook"),
dict(type="WeightSummary"),
dict(type="MeanTeacher", momentum=0.999, interval=1, warm_up=0)
dict(type="MeanTeacher", momentum=0.999, interval=1, warm_up=0),
]
evaluation = dict(type="SubModulesDistEvalHook", interval=4000)
optimizer = dict(type="SGD", lr=0.01, momentum=0.9, weight_decay=0.0001)
Expand All @@ -269,7 +269,7 @@
log_config = dict(
interval=50,
hooks=[
dict(type="TextLoggerHook"),
dict(type="TextLoggerHook", by_epoch=False),
dict(
type="WandbLoggerHook",
init_kwargs=dict(
Expand Down
5 changes: 3 additions & 2 deletions ssod/utils/hooks/submodules_evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _do_evaluate(self, runner):
if not self._should_evaluate(runner):
return
# TODO: add `runner.mode = "val"`

runner.log_buffer.clear()
tmpdir = self.tmpdir
if tmpdir is None:
tmpdir = osp.join(runner.work_dir, ".eval_hook")
Expand Down Expand Up @@ -81,12 +81,13 @@ def _do_evaluate(self, runner):
best_score = key_score

print("\n")
runner.log_buffer.output["eval_iter_num"] = len(self.dataloader)
# runner.log_buffer.output["eval_iter_num"] = len(self.dataloader)
if self.save_best:
self._save_ckpt(runner, best_score)

def evaluate(self, runner, results, prefix=""):
"""Evaluate the results.
Args:
runner (:obj:`mmcv.Runner`): The underlined training runner.
results (list): Output results.
Expand Down

0 comments on commit bd17829

Please sign in to comment.