# Does Ultralytics support model Pruning?

**URL:** <https://community.ultralytics.com/t/does-ultralytics-support-model-pruning/1680>\
**Category:** Discussion\
**Tags:** discussion, curious\
**Created:** [December 2, 2025, 2:08am UTC](https://community.ultralytics.com/t/does-ultralytics-support-model-pruning/1680 "2025-12-02T02:08:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AA278-HUB](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/aa278-hub/32/1064_2.png) [@AA278-HUB](https://community.ultralytics.com/u/AA278-HUB)\
**Post date:** [December 2, 2025, 2:08am UTC](https://community.ultralytics.com/t/does-ultralytics-support-model-pruning/1680/1 "2025-12-02T02:08:12Z")

</div>

and After pruning my YOLO model, Ultralytics can’t load it due to shape/key mismatches. Can pruned models still be validated with `model.val()`?

---

<div class="post-metadata">

**Author:** ![Toxite](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/toxite/32/123_2.png) [@Toxite](https://community.ultralytics.com/u/Toxite)\
**Post date:** [December 2, 2025, 10:54am UTC](https://community.ultralytics.com/t/does-ultralytics-support-model-pruning/1680/2 "2025-12-02T10:54:17Z")

</div>

No. It would work only if you export the pruned model manually to ONNX.

---

<div class="post-metadata">

**Author:** ![AA278-HUB](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/aa278-hub/32/1064_2.png) [@AA278-HUB](https://community.ultralytics.com/u/AA278-HUB)\
**Post date:** [December 2, 2025, 2:36pm UTC](https://community.ultralytics.com/t/does-ultralytics-support-model-pruning/1680/3 "2025-12-02T14:36:57Z")

</div>

thank you

---

<div class="post-metadata">

**Author:** ![pderrenger](https://sea1.discourse-cdn.com/flex001/user_avatar/community.ultralytics.com/pderrenger/32/73_2.png) [@pderrenger](https://community.ultralytics.com/u/pderrenger)\
**Post date:** [December 3, 2025, 1:30pm UTC](https://community.ultralytics.com/t/does-ultralytics-support-model-pruning/1680/4 "2025-12-03T13:30:45Z")

</div>

You’re welcome!

Just to add a small clarification: Ultralytics YOLO models don’t currently have built‑in pruning utilities or support for loading _structurally_ pruned checkpoints, so once pruning changes tensor shapes or module structure you can’t reload them into `YOLO()` or use `model.val()`, as Toxite mentioned. If you only do unstructured pruning (weights are zeroed but shapes stay the same), the original Ultralytics model can still be loaded and validated; most structured channel/filter pruning will not.

For pruned architectures, treat the network as a standard PyTorch model, export it manually to ONNX with `torch.onnx.export`, and validate or benchmark it using your own loop or an engine like ONNX Runtime. If you want a quick conceptual refresher on how pruning works with YOLO-style models, the Ultralytics [model pruning overview](https://www.ultralytics.com/glossary/model-pruning) gives a concise summary.
