Skip to content

Fix validation epoch metadata for visual backends - #1693

Open
dgexplores wants to merge 2 commits into
open-mmlab:mainfrom
dgexplores:fix/wandb-epoch-axis
Open

dgexplores wants to merge 2 commits into
open-mmlab:mainfrom
dgexplores:fix/wandb-epoch-axis

Conversation

@dgexplores

Copy link
Copy Markdown

Summary

  • include the validation epoch in the scalar payload when log_metric_by_epoch=True
  • add regression coverage for the epoch-based validation logging path

This lets visualization backends such as WandbVisBackend define an epoch-based x-axis from the emitted scalar metadata. The scalar step remains unchanged.

Fixes #1692.

Validation

  • pytest tests/test_hooks/test_logger_hook.py -q → 7 passed
  • git diff --check → passed

The focused test run emitted existing PyTorch deprecation warnings only.

@CLAassistant

CLAassistant commented Aug 14, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dgexplores
dgexplores marked this pull request as ready for review August 14, 2026 20:51
@dgexplores

Copy link
Copy Markdown
Author

Hi @nfcampos @hwchase17 @sydney-runkle,

This PR addresses mmengine issue for validation epoch metadata in visual backends (WandB).

Changes made:

  • mmengine/hooks/logger_hook.py: Added tag['epoch'] = epoch line
  • tests/test_hooks/test_logger_hook.py: Added regression test test_after_val_epoch

The fix ensures epoch data is properly captured during validation loops for visual backends.

Following OpenMMLab contributing guidelines, this PR is ready for review.

  • Fix validates epoch metadata that was previously lost
  • Test coverage added for sync validation loop
  • Minimal changes - only 2 files modified (+7 total lines)

Thank you for reviewing!

@dgexplores

Copy link
Copy Markdown
Author

CI note: the ci/circleci: lint failure on this PR is not caused by this patch.

ci/circleci: lint is currently red on every open PR in this repository — #1696, #1699 and #1700 all fail the same job. I verified this patch against the exact recipe in .circleci/test.yml locally instead:

  • pre-commit run --all-files → all 17 hooks passed (flake8, isort, yapf, mypy, docformatter, pyupgrade, mdformat, check-copyright, …)
  • interrogate -v --ignore-init-method --ignore-module --ignore-nested-functions --ignore-regex "__repr__" --fail-under 80 mmengine → 80.7% (PASSED)
  • pytest tests/test_runner/test_runner.py -k "test_train or after_val_epoch" → passing
  • branch base is identical to main; no config drift

The lint job runs pip install pre-commit (unpinned) on the cimg/python:3.7.4 image, so this looks like upstream CI breakage rather than anything in individual diffs. #1683 ("Update pre-commit config to fix CI failure") was opened in January to address it and was closed unmerged.

Happy to rebase onto a newer main or adjust the patch if there is feedback on the approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] WandbVisBackend can't set the X‑axis to epoch, because LoggerHook does not consistently pass the epoch value

2 participants