[Bug] WandbVisBackend can't set the X‑axis to epoch, because LoggerHook does not consistently pass the epoch value
Nobody has claimed this yet.
- #1693 by @dgexplores — closed without merging
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- observability
Research direction
Start by reading LoggerHook, especially after_val_epoch, and trace how its tag is passed to runner.visualizer.add_scalars with WandbVisBackend. Confirm the epoch value is included consistently in the logged tag, then verify that configuring the Wandb metric with epoch as the X-axis works without breaking validation logging.
Written by the indexing model from the issue text.
Description
Prerequisite
- I have searched Issues and Discussions but cannot get the expected help.
- The bug has not been fixed in the latest version(https://github.com/open-mmlab/mmengine).
Environment
v0.11.0r3
Reproduces the problem - code sample
define_metric_cfg = [dict(name='epoch', hidden=True)]
cfg.visualizer.vis_backends.append(dict(type='WandbVisBackend', init_kwargs=wandb_init_kwargs, define_metric_cfg=define_metric_cfg))
Reproduces the problem - command or script
None
Reproduces the problem - error message
Additional information
solution
@HOOKS.register_module()
class LoggerHook(Hook):
....
def after_val_epoch(self,...
if (isinstance(runner._train_loop, dict)
or runner._train_loop is None):
epoch = 0
else:
epoch = runner.epoch
----------------------
tag['epoch'] = epoch # add this line can fix it
----------------------
runner.visualizer.add_scalars(
tag, step=epoch, file_path=self.json_log_path)
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 470
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from open-mmlab/mmengine
-
[Bug] fail to build with python 3.13Possibly taken @hubutui claimed this 709 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
open-mmlab/mmengine#1616 · 6 comments · 3 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
open-mmlab/mmengine#1697 · 1 comment ·
-
[Bug] MlflowVisBackend fails due to use of deprecated filesystem storePossibly taken @appleweiping claimed this 85 days ago. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 58/100
open-mmlab/mmengine#1687 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
open-mmlab/mmengine#1685 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
open-mmlab/mmengine#1684 ·
All issues in open-mmlab/mmengine
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 69/100
anderspitman/awesome-tunneling#330 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
521xueweihan/HelloGitHub#4676 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
Maintainers usually reply within 18 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pandas-dev/pandas-stubs#2155 ·
Maintainers usually reply within 1 day
-
essreduce
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day