I use Roboflow a lot for labeling datasets to train my custom YOLOv8 model, it would be nice if I could upload my custom YOLOv8 pt file and use it to annotate my new images. I know there is already a feature like this however it does not allow me to upload custom externally trained models which is very annoying and inconvenient, it would be wonderful if this requested feature could be added for me and tons of other users.
Hi @ChillArmo - we do have this feature available, actually!
Here is how it works, along with the training tutorial: Upload Weights - Roboflow
All model training notebooks also available here: GitHub - roboflow/notebooks: Set of Jupyter Notebooks linked to Roboflow blog posts and used in our YouTube videos.
Thank you for the response I found the code from the colab notebook & I’ve just uploaded the model.
However I seem to be getting an error " MODEL UPLOAD FAILED Your uploaded model will be ready to use soon! " I am uploading my custom model pretrained on YOLOv8s and for some reason it just keeps on failing.
I’m running this code
rf = roboflow.Roboflow(api_key=“apiKey”)
###List all projects for your workspace
workspace = rf.workspace()
###Load a certain project (workspace url is optional)
project = rf.workspace(“pnofn”).project(“elec-stuff”)
dataset = project.version(15)
project.version(dataset.version).deploy(model_type=“yolov8”, model_path=“houseplan/elecStuffBigger”)
@ChillArmo I just ran through the full flow in this notebook, and weights uploaded without error: Google Colab
Why was the value for, model_path
adjusted from model_path=f"{HOME}/runs/detect/train/”
to model_path=“houseplan/elecStuffBigger”
?
(1) Is houseplan/elecStuffBigger/weights/best.pt
where your model weights were stored?
(2) Or was it more of, just uploading weights to the notebook after downloading the dataset, and then doing the deploy code?
- If this is the case, this will be the path I’ll need to explore further
So in this case, I’ve adapted the code to run locally on my pc where I have trained the model, perhaps running the deploy method without first checking the docs and trying to adapt a colab line to pc didn’t work out the way I wanted it to.
Update: I’ve done it once more adapting this snippet from the docs to my code, URL:Upload Weights - Roboflow
version = project.version(13)
version.deploy(model_type=“yolov8”, model_path=“houseplan/elecStuffBigger”)
Update2:
Hi @ChillArmo can you re-run the process with a newly generated version?
This time with the imgsz
parameter explicitly set in your training code?
- Example: resized images to
640x640
, setimgsz=640
in the training code? in my training code imgsz=1280, is that probably why it won’t ever finish processing? Also I just tried uploading again and got hit with this error “Please specify the model type. If using the Roboflow Python package, please update to >=1.0.1”
version = project.version(16)
version.deploy(model_type="yolov8", model_path="houseplan/elecStuffBigger17")
I saw that our engineering team made another update to the processing for the model weights uploads.
Can you email the direct link to your notebook to help@roboflow.com, and include the link to this post?
I’ll try running the process for you, and provide the notebook back to you.