From cc9513f8477822ede0eea270e5e251553f2b954d Mon Sep 17 00:00:00 2001 From: MilkClouds Date: Mon, 12 Dec 2022 15:37:31 +0900 Subject: [PATCH] [Fix]: Fix deadlock issue related with MMDetWandbHook (#9476) Co-authored-by: WangYudong Co-authored-by: WangYudong --- mmdet/core/hook/wandblogger_hook.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mmdet/core/hook/wandblogger_hook.py b/mmdet/core/hook/wandblogger_hook.py index 234506ce313..7bf252f0113 100644 --- a/mmdet/core/hook/wandblogger_hook.py +++ b/mmdet/core/hook/wandblogger_hook.py @@ -235,7 +235,8 @@ def after_train_epoch(self, runner): # Log the table self._log_eval_table(runner.epoch + 1) - @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 @@ -245,7 +246,10 @@ def after_train_iter(self, runner): return super(MMDetWandbHook, self).after_train_iter(runner) else: super(MMDetWandbHook, self).after_train_iter(runner) + self._after_train_iter(runner) + @master_only + def _after_train_iter(self, runner): if self.by_epoch: return