Skip to content

Commit

Permalink
[Feature] Dedicated MMSegWandbHook for MMSegmentation (Weights and Bi…
Browse files Browse the repository at this point in the history
…ases Integration) (#1603)

* wandb integration

* wandb integration

* Update mmseg/core/hook/wandblogger_hook.py

Co-authored-by: 谢昕辰 <[email protected]>

* trying to fix circular import issue

* Update mmseg/core/hook/wandblogger_hook.py docstring

Try to activate the CI.

* move import op in func

* add comments to test_fn

Co-authored-by: xiexinch <[email protected]>
Co-authored-by: 谢昕辰 <[email protected]>
  • Loading branch information
3 people authored Jul 1, 2022
1 parent 5c113d9 commit dca46fe
Show file tree
Hide file tree
Showing 4 changed files with 377 additions and 1 deletion.
1 change: 1 addition & 0 deletions mmseg/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from .builder import (OPTIMIZER_BUILDERS, build_optimizer,
build_optimizer_constructor)
from .evaluation import * # noqa: F401, F403
from .hook import * # noqa: F401, F403
from .optimizers import * # noqa: F401, F403
from .seg import * # noqa: F401, F403
from .utils import * # noqa: F401, F403
Expand Down
6 changes: 5 additions & 1 deletion mmseg/core/evaluation/eval_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def __init__(self,
**kwargs):
super().__init__(*args, by_epoch=by_epoch, **kwargs)
self.pre_eval = pre_eval
self.latest_results = None

if efficient_test:
warnings.warn(
'DeprecationWarning: ``efficient_test`` for evaluation hook '
Expand All @@ -48,6 +50,7 @@ def _do_evaluate(self, runner):
from mmseg.apis import single_gpu_test
results = single_gpu_test(
runner.model, self.dataloader, show=False, pre_eval=self.pre_eval)
self.latest_results = results
runner.log_buffer.clear()
runner.log_buffer.output['eval_iter_num'] = len(self.dataloader)
key_score = self.evaluate(runner, results)
Expand Down Expand Up @@ -80,6 +83,7 @@ def __init__(self,
**kwargs):
super().__init__(*args, by_epoch=by_epoch, **kwargs)
self.pre_eval = pre_eval
self.latest_results = None
if efficient_test:
warnings.warn(
'DeprecationWarning: ``efficient_test`` for evaluation hook '
Expand Down Expand Up @@ -116,7 +120,7 @@ def _do_evaluate(self, runner):
tmpdir=tmpdir,
gpu_collect=self.gpu_collect,
pre_eval=self.pre_eval)

self.latest_results = results
runner.log_buffer.clear()

if runner.rank == 0:
Expand Down
4 changes: 4 additions & 0 deletions mmseg/core/hook/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) OpenMMLab. All rights reserved.
from .wandblogger_hook import MMSegWandbHook

__all__ = ['MMSegWandbHook']
Loading

0 comments on commit dca46fe

Please sign in to comment.