-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The size of YOLOv5s is 14 megabytes #3416
Comments
@leeyunhome the size of the latest YOLOv5 models is shown in the assets section of the releases. These models were trained using the same exact steps as in our Train Custom Data tutorial: |
👋 Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs. Access additional YOLOv5 🚀 resources:
Access additional Ultralytics ⚡ resources:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed! Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐! |
@glenn-jocher
What could be the reason and how can I solve it? |
👋 Hello! Thanks for asking about training checkpoints. YOLOv5 🚀 checkpoints should be about 4X the size of final trained checkpoints, as they carry not just a FP16 model, but a FP16 EMA and an FP32 optimizer of the same size as the model (each model parameter has its own FP32 gradient saved within the optimizer). Final checkpoints contain only an FP16 model, with the EMA and optimizer both stripped after the final epoch of training: Lines 423 to 425 in b4a29b5
The Lines 741 to 755 in b4a29b5
Final trained checkpoints after You can also run from utils.general import strip_optimizer
strip_optimizer('path/to/best.pt')
!python train.py --weights path/to/best.pt # use best.pt to train a new model Model ExportsExported models may be larger or smaller than their PyTorch starting points depending on their quantization. i.e. FP16 models will be the same size, FP32 models will be 2X the size, and INT8 models will be 0.5X the size. See YOLOv5 Export tutorial for quantization options on model export. Good luck 🍀 and let us know if you have any other questions! |
❔Question
The size of YOLOv5s is 14 megabytes, but when I actually train it, it comes out to 15 megs.
Could there be such a difference?
Additional context
The text was updated successfully, but these errors were encountered: