Skip to main content
This page shows you how to use W&B with OpenMMLab’s MMEngine to track and visualize training runs. Use it if you train deep learning models with MMEngine or OpenMMLab computer vision libraries and want to log metrics, configs, and visualizations to W&B. MMEngine by OpenMMLab is a foundational library for training deep learning models based on PyTorch. MMEngine implements a training architecture for the OpenMMLab algorithm library, providing a unified execution foundation for over 30 algorithm libraries within OpenMMLab. Its core components include the training engine, evaluation engine, and module management. MMEngine integrates directly with W&B through a dedicated WandbVisBackend that you can use to:
  • Log training and evaluation metrics.
  • Log and manage experiment configs.
  • Log additional records such as graphs, images, and scalars.

Get started

Install openmim and wandb.
Next, install mmengine and mmcv using mim.

Use the WandbVisBackend with MMEngine runner

This section demonstrates a typical workflow using WandbVisBackend with mmengine.runner.Runner. The visualizer wraps the W&B backend so the MMEngine runner can route logs to W&B during training.
  1. Define a visualizer from a visualization config. The visualizer is what the runner uses to dispatch logs to the configured backend.
    You pass a dictionary of arguments for W&B run initialization input parameters to init_kwargs.
  2. Initialize a runner with the visualizer, and call runner.train() to start training. The runner uses the visualizer to stream metrics and configs to W&B.

Use the WandbVisBackend with OpenMMLab computer vision libraries

You can also use the WandbVisBackend to track experiments with OpenMMLab computer vision libraries such as MMDetection. The following example overrides the vis_backends entry from a base config so that the existing visualizer logs to W&B.