PaddleDetection

How to integrate W&B with PaddleDetection.

PaddleDetection is an end-to-end object-detection development kit based on PaddlePaddle. It detects various mainstream objects, segments instances, and tracks and detects keypoints using configurable modules such as network components, data augmentations, and losses.

PaddleDetection now includes a built-in W&B integration which logs all your training and validation metrics, as well as your model checkpoints and their corresponding metadata.

The PaddleDetection WandbLogger logs your training and evaluation metrics to Weights & Biases as well as your model checkpoints while training.

Read a W&B blog post which illustrates how to integrate a YOLOX model with PaddleDetection on a subset of the COCO2017 dataset.

Use PaddleDetection with W&B

Sign up and log in to W&B

Sign up for a free Weights & Biases account, then pip install the wandb library. To login, you’ll need to be signed in to you account at www.wandb.ai. Once signed in you will find your API key on the Authorize page.

pip install wandb

wandb login
!pip install wandb

wandb.login()

Activate the WandbLogger in your training script

Use the CLI

To use wandb via arguments to train.py in PaddleDetection:

  • Add the --use_wandb flag
  • The first wandb arguments must be preceded by -o (you only need to pass this once)
  • Each individual wandb argument must contain the prefix wandb- . For example any argument to be passed to wandb.init would get the wandb- prefix
python tools/train.py 
    -c config.yml \ 
    --use_wandb \
    -o \ 
    wandb-project=MyDetector \
    wandb-entity=MyTeam \
    wandb-save_dir=./logs

Use a config.yml file

You can also activate wandb via the config file. Add the wandb arguments to the config.yml file under the wandb header like so:

wandb:
  project: MyProject
  entity: MyTeam
  save_dir: ./logs

Once you run your train.py file with Weights & Biases turned on, a link will be generated to bring you to your W&B dashboard:

A Weights & Biases Dashboard

Feedback or issues

If you have any feedback or issues about the Weights & Biases integration please open an issue on the PaddleDetection GitHub or email support@wandb.com.


Last modified January 30, 2025: 2e2f132