My modified model show two different summaries

Please I very need to understand. I’m working on a modified yolo model but I faced this thing: I have different summary when start the training and when completed it:

MM summary: 465 layers, 1,186,399 parameters, 1,186,383 gradients, 3.6 GFLOPs

TensorBoard: Start with ‘tensorboard --logdir /content/drive/MyDrive/yolov11/runs/detect/train54’, view at http://localhost:6006/
Freezing layer ‘model.29.dfl.conv.weight’
train: Scanning /content/drive/MyDrive/ultralytics/datasets/UAV/labels/train.cache… 5197 images, 3 backgrounds, 0 corrupt: 100% 5200/5200 [00:00<?, ?it/s]
/content/drive/MyDrive/yolov11/ultralytics/data/augment.py:1850: UserWarning: Argument(s) ‘quality_lower’ are not valid for transform ImageCompression
A.ImageCompression(quality_lower=75, p=0.0),
albumentations: Blur(p=0.01, blur_limit=(3, 7)), MedianBlur(p=0.01, blur_limit=(3, 7)), ToGray(p=0.01, method=‘weighted_average’, num_output_channels=3), CLAHE(p=0.01, clip_limit=(1.0, 4.0), tile_grid_size=(8, 8))
val: Scanning /content/drive/MyDrive/ultralytics/datasets/UAV/labels/val.cache… 2600 images, 0 backgrounds, 0 corrupt: 100% 2600/2600 [00:00<?, ?it/s]
Plotting labels to /content/drive/MyDrive/yolov11/runs/detect/train54/labels.jpg…
optimizer: ‘optimizer=auto’ found, ignoring ‘lr0=0.01’ and ‘momentum=0.937’ and determining best ‘optimizer’, ‘lr0’ and ‘momentum’ automatically…
optimizer: SGD(lr=0.01, momentum=0.9) with parameter groups 102 weight(decay=0.0), 123 weight(decay=0.0005), 122 bias(decay=0.0)
TensorBoard: model graph visualization added ✅
Image sizes 640 train, 640 val
Using 2 dataloader workers

The end:

300 epochs completed in 18.585 hours.
Optimizer stripped from /content/drive/MyDrive/yolov11/runs/detect/train54/weights/last.pt, 2.9MB
Optimizer stripped from /content/drive/MyDrive/yolov11/runs/detect/train54/weights/best.pt, 2.9MB

Validating /content/drive/MyDrive/yolov11/runs/detect/train54/weights/best.pt…
Ultralytics 8.3.9 🚀 Python-3.12.12 torch-2.8.0+cu126 CUDA:0 (Tesla T4, 15095MiB)
MM summary: 385 layers, 985,255 parameters, 73,856 gradients, 8.6 GFLOPs
Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100% 82/82 [00:48<00:00,  1.70it/s]
all       2600       2621      0.948      0.849      0.882      0.583
Speed: 0.2ms preprocess, 3.9ms inference, 0.0ms loss, 2.0ms postprocess per image

Why this happen?

The final one is validated using a model with fused layers. Like Conv + BatchNorm fused to one. So it has less number of parameters and layers.

@Toxite thanks for reply, Can you explain more please? So the final best.pt has the fused layers? Why the GFLOPs increased? and If I want to compare my model with the others, what should I base my comparison on? MM summary: 465 layers, 1,186,399 parameters, 1,186,383 gradients, 3.6 GFLOPs OR MM summary: 385 layers, 985,255 parameters, 73,856 gradients, 8.6 GFLOPs

You should use a newer version of Ultralytics. Yours is over 1 year old. There might be a bug in the version you’re using

I am using google colab and I think it install the one!

1 Like

Colab often comes with an older preinstalled Ultralytics, so you won’t automatically get the latest. Please upgrade explicitly, restart the runtime, and verify the version:

pip uninstall -y ultralytics
pip install -U ultralytics
import ultralytics
print(ultralytics.__version__)

The mismatch you saw is from layer fusion at validation/inference time (Conv+BN fused), plus the old build had a GFLOPs reporting bug. After updating, summaries should be consistent and will indicate when the model is fused. If you want to see both, do:

from ultralytics import YOLO

m = YOLO("path/to/best.pt").model
m.info()          # unfused
m.fuse(); m.info()  # fused

For apples-to-apples comparisons, use inference (fused) metrics and latency. You can read more about fusion in the Model.fuse() docs under the Ultralytics API reference.

2 Likes

Thanks for reply. I will check your solution but before that please could you see this output of the slandered yolo11 :

Ultralytics 8.3.9 🚀 Python-3.12.11 torch-2.8.0+cu126 CUDA:0 (Tesla T4, 15095MiB)
YOLO11 summary (fused): 352 layers, 2,556,923 parameters, 0 gradients, 6.3 GFLOPs

It already fused the layers but my modified model I used Detect_LSDECD and the output summary was without (fused):

Ultralytics 8.3.9 🚀 Python-3.12.12 torch-2.8.0+cu126 CUDA:0 (Tesla T4, 15095MiB)
MM summary: 385 layers, 985,255 parameters, 73,856 gradients, 8.6 GFLOPs

And this is the output of your code:

Note I used another model and same results there is a difference in the GFLOPs.

I think the new detection head cause this issue, but I do not know how to avoid it :frowning:

MM summary: 409 layers, 1,233,111 parameters, 0 gradients, 3.3 GFLOPs
MM summary: 356 layers, 1,032,703 parameters, 73,856 gradients, 8.2 GFLOPs
MM summary: 356 layers, 1,032,703 parameters, 73,856 gradients, 8.2 GFLOPs

(356, 1032703, 73856, 8.241053568)