During training and evaluation of a YOLO (You Only Look Once) object detection model, the console output provides key insights into performance and resource usage. Below is a breakdown of the typical metrics shown:
Training Log Example
Epoch GPU_mem box_loss obj_loss cls_loss Instances Size
49/49 7.55G 0.03141 0.05182 0.0003582 104 640: 100%|██████████| 12/12 [00:03<00:00, 3.80it/s]
- Epoch 49/49: The model has completed its final training epoch (out of 49 total).
- GPU_mem 7.55G: Approximately 7.55 GB of GPU memory is in use.
- box_loss: Localization error between predicted and ground-truth bounding boxes (lower is better).
- obj_loss: Measures how well the model detects whether an object is present in a region.
- cls_loss: Classification error—how accurate the model assigns correct class labels.
- Instances 104: Total object instances processed in this epoch.
- Size 640: Input images are resized to 640×640 pixels.
- Progress bar: Indicates 12 batches were processed in ~3 seconds at ~3.8 iterations per second.
Validation Metrics
Class Images Instances P R mAP50 mAP50-95: 100%|██████████| 2/2 [00:00<00:00, 2.62it/s]
all 89 1006 0.966 0.935 0.98 0.655
- Images: 89 validation images used.
- Instances: 1006 annotated objects across those images.
- Precision (P) = 0.966: 96.6% of detected objects are true positives.
- Recall (R) = 0.935: The model detected 93.5% of all actual objects.
- mAP50 = 0.98: Mean Average Percision at IoU threshold ≥ 0.5.
- mAP50-95 = 0.655: Average mAP across IoU thresholds from 0.5 to 0.95 (in 0.05 increments).
Training Completion Summary
50 epochs completed in 0.059 hours.
Optimizer stripped from runs/train/exp8/weights/last.pt, 14.4MB
Optimizer stripped from runs/train/exp8/weights/best.pt, 14.4MB
The full training run finished in about 3.5 minutes. The optimizer state was removed from both last.pt (final epoch weights) and best.pt (weights with highest validation mAP), reducing file size for inference-only deployment.
Model Validation and Summary
Validating runs/train/exp8/weights/best.pt...
Fusing layers...
Model summary: 157 layers, 7015519 parameters, 0 gradients, 15.8 GFLOPs
- Fusing layers: Optimization step that merges batch normalization into convolutional layers for faster inference.
- 157 layers: Total number of layers in the network architecture.
- 7,015,519 parameters: Total trainable weights before optimization.
- 0 gradients: Confirms the model is in evaluation mode (no backpropagation).
- 15.8 GFLOPs: Computational cost per forward pass—useful for estimating inference speed on different hardware.
Per-Class Validation Results
Class Images Instances P R mAP50 mAP50-95
all 89 1006 0.966 0.935 0.98 0.654
hat 89 1006 0.966 0.935 0.98 0.654
In this single-class scenario ("hat"), per-class metrics match the overall results. All output and weights are saved under runs/train/exp8/.