Upload Custom Weights
Roboflow offers the ability to upload model weights for your custom-trained models to your Roboflow projects for model deployment.
Model weights uploads are currently available for:
- YOLOv5 (n, s, m, l, x) Object Detection and Instance Segmentation
- YOLOv7 Instance Segmentation (yolov7-seg)
- YOLOv8 (n, s, m, l, x) Object Detection, Instance Segmentation, and Classification
After successfully training your custom YOLOv5, YOLOv7 or YOLOv8 model, use the
.deploy()function to upload your model weights back to your Roboflow Object Detection project.
Model weights uploads are only available for dataset versions without a trained model (i.e not yet trained with Roboflow Train, and no YOLOv5, YOLOv7 or YOLOv8 model weights uploaded).
NOTE: Larger model sizes provide better training results. However, the larger the model size, the slower the training time, and inference (model prediction) speed. Consider whether you're looking for real-time inference on fast-moving objects or video feeds (better to use a smaller model), or you are processing data after it is collected, and more concerned with higher prediction accuracy (choose a larger model).
You need the
roboflow>=1.0.1Python package version to use the
To upload custom weights, use the
model.deploy()method in the Python SDK.
version = project.version(1)
The following model types are supported:
- yolov5, yolov5-seg
- yolov7, yolov7-seg
- yolov8, yolov8-seg, yolov8-cls
If weights upload is attempted for dataset versions that already have a trained model (a Roboflow Train model or uploaded YOLOv5, YOLOv7 or YOLOv8 weights) then you will receive a
"This version already has a trained model. Please generate and train a new version in order to upload model to Roboflow."
If upload is attempted for a model architecture that is not yet supported for weights upload, then you will receive a
Last modified 2mo ago