From e2fd5c0135349909980ade94aa243b4930967bcb Mon Sep 17 00:00:00 2001 From: MilkClouds Date: Sun, 11 Dec 2022 05:35:29 +0000 Subject: [PATCH] Fixed deadlock issue related with MMSegWandbHook Co-authored-by: WangYudong --- mmseg/core/hook/wandblogger_hook.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mmseg/core/hook/wandblogger_hook.py b/mmseg/core/hook/wandblogger_hook.py index 20a7b12bae..b35c526051 100644 --- a/mmseg/core/hook/wandblogger_hook.py +++ b/mmseg/core/hook/wandblogger_hook.py @@ -168,7 +168,8 @@ def before_run(self, runner): # Log ground truth data self._log_data_table() - @master_only + # for the reason of this double-layered structure, refer to + # https://github.com/open-mmlab/mmdetection/issues/8145#issuecomment-1345343076 def after_train_iter(self, runner): if self.get_mode(runner) == 'train': # An ugly patch. The iter-based eval hook will call the @@ -178,7 +179,10 @@ def after_train_iter(self, runner): return super(MMSegWandbHook, self).after_train_iter(runner) else: super(MMSegWandbHook, self).after_train_iter(runner) + self._after_train_iter(runner) + @master_only + def _after_train_iter(self, runner): if self.by_epoch: return