Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Dedicated MMSegWandbHook for MMSegmentation (Weights and Biases Integration) #1603

Merged
merged 9 commits into from
Jul 1, 2022
Merged
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