Fixed deadlock issue related with MMSegWandbHook (#2398)

Co-authored-by: WangYudong <yudong.wang@akane.waseda.jp>
pull/2489/head
MilkClouds 2022-12-11 05:35:29 +00:00 committed by MeowZheng
parent 320d8c60f3
commit c0515a1be5
1 changed files with 5 additions and 1 deletions

View File

@ -168,7 +168,8 @@ class MMSegWandbHook(WandbLoggerHook):
# 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 @@ class MMSegWandbHook(WandbLoggerHook):
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