WandB integration and confusion matrix #21646
-
I am performing training using YOLOv8, YOLOv9, YOLOv10, and YOLOv11 on wandb. However, I am not able to get the confusion matrix printed out as part of the loggings on wandb. Any help on how to do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
👋 Hello @CyrusAddy, thanks for opening this discussion and for using Ultralytics 🚀! This is an automated response to help you get quick guidance while an Ultralytics engineer reviews your post and will assist you soon. For general usage, we recommend visiting the Docs where you can find many Python and CLI examples and answers to common questions:
If this is a 🐛 Bug Report (e.g., expected confusion matrix not appearing in Weights & Biases logs), please share a minimum reproducible example to help us debug it: If this is a custom training ❓ Question about configuration or integrations, please include:
Join the Ultralytics community where it suits you best:
UpgradePlease upgrade to the latest ultralytics package with all requirements in a Python>=3.8 environment with PyTorch>=1.8 to ensure the issue isn’t already resolved: pip install -U ultralytics EnvironmentsYOLO can be run in the following verified environments (with dependencies like CUDA/CUDNN, Python, and PyTorch preinstalled):
StatusIf this badge is green, all Ultralytics CI tests are passing. CI tests verify correct operation of all YOLO Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit. Once you share the requested details (including an MRE if it’s a bug), we’ll be able to assist you more effectively. Thanks for your patience and for trying YOLOv8, YOLOv9, YOLOv10, and YOLO11 with W&B integration 🙌 |
Beta Was this translation helpful? Give feedback.
Hi @CyrusAddy — W&B logs the confusion matrix as an image when validation plots are enabled; enable W&B and plots, then train or run a val pass to push it:
yolo settings wandb=True
yolo train model=yolo11n.pt data=your.yaml plots=True
or for an existing model
yolo val model=path/to/best.pt data=your.yaml plots=True
You’ll see confusion_matrix_normalized under Images in the run; this is produced by the confusion matrix plot and logged via the W&B callback that uploads validator.plots at epoch/end of training. Details are in the YOLO + Weights & Biases integration guide and the W&B callback reference.