Unable to up deploy a custom trained yolov5 model on robotflow
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
调研方向
从 version.deploy(model_type, model_path, filename) 开始,跟踪用于 yolov5 权重的 torch.load 调用。使用提供的自定义模型路径重现失败,并将其与可正常工作的 torch.hub.load 示例进行比较。当可以通过 deploy 成功上传经过自定义训练的 yolov5 权重文件时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
``
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.
- 主要语言
- Python
- 星标
- 633
- 派生
- 140
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 11
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
roboflow/roboflow-python 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
roboflow/roboflow-python#505 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 30/100
roboflow/roboflow-python#433 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 25/100
roboflow/roboflow-python#429 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
roboflow/roboflow-python#427 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
roboflow/roboflow-python#426 ·
维护者通常 1 天内回复
查看 roboflow/roboflow-python 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 1/5 1 小时以内 新手友好度 75/100
-
难度 1/5 1 小时以内 新手友好度 85/100
-
难度 1/5 1 小时以内 新手友好度 85/100
data-umbrella/du-event-board#225 ·
-
难度 2/5 1-3 小时 新手友好度 75/100