roboflow / roboflow/roboflow-python
Unable to up deploy a custom trained yolov5 model on robotflow
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 629
- Forks
- 140
- Ø Merge
- 2 T. 2 Std.
- Gemergte PRs (30 T.)
- 5
Beschreibung
``
It has been impossible to upload a yolov5 model trained on a custom dataset. My folder
rf = roboflow.Roboflow(api_key="..")
project = rf.workspace().project("...")
version = project.version(2)
version.deploy("yolov5", "yolov5/runs/train/exp2")
I've got this error
It' an issue that arise as resulting of calling the function torch.load on the parameter : os.path.join(model_path, filename). This function attempts to load the yolov5 model using the same argument used as input for the function deploy. Recall the functions deploy inputs :
(method) def deploy(
model_type: str,
model_path: str,
filename: str = "weights/best.pt"
) -> None
Uploads provided weights file to Roboflow.
Args:
model_type (str): The type of the model to be deployed.
model_path (str): File path to the model weights to be uploaded.
filename (str, optional): The name of the weights file. Defaults to "weights/best.pt".
I tried :
torch.load(os.path.join("yolov5/runs/train/exp2", "weights/best.pt"))
but still getting the same error. According to my research, loading former yolo model versions has usually been done using torch.hub.load rather than torch.load. In fact
torch.hub.load('.', 'custom', path='/path/to/yolov5/runs/train/exp5/weights/best.pt', source='local')
works fine.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne bei version.deploy(model_type, model_path, filename) und verfolge den Aufruf von torch.load für yolov5-Gewichte. Reproduziere den Fehler mit dem bereitgestellten benutzerdefinierten Modellpfad und vergleiche ihn mit dem funktionierenden torch.hub.load-Beispiel. Erledigt bedeutet, dass eine Datei mit Gewichten eines benutzerdefinierten yolov5-Trainings erfolgreich über deploy hochgeladen werden kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, pytorch
- Bereich
- computer-vision, machine-learning
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100