Unverified Commit d636257e authored by shenmishajing's avatar shenmishajing Committed by GitHub
Browse files

[Fix] Fix wandb logger drop result bug (#913)

* fix wandb logger drop result bug by delete step param

* add global_step in wandb log to help align train and val step log

* fix wandb hook test unit fail bug

* fix lint issue

* add with_step param of WandbLoggerHook in wandb.py
parent d525cfde
......@@ -13,12 +13,14 @@ class WandbLoggerHook(LoggerHook):
ignore_last=True,
reset_flag=True,
commit=True,
by_epoch=True):
by_epoch=True,
with_step=True):
super(WandbLoggerHook, self).__init__(interval, ignore_last,
reset_flag, by_epoch)
self.import_wandb()
self.init_kwargs = init_kwargs
self.commit = commit
self.with_step = with_step
def import_wandb(self):
try:
......@@ -41,8 +43,12 @@ class WandbLoggerHook(LoggerHook):
def log(self, runner):
tags = self.get_loggable_tags(runner)
if tags:
self.wandb.log(
tags, step=self.get_iter(runner), commit=self.commit)
if self.with_step:
self.wandb.log(
tags, step=self.get_iter(runner), commit=self.commit)
else:
tags['global_step'] = self.get_iter(runner)
self.wandb.log(tags, commit=self.commit)
@master_only
def after_run(self, runner):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment