2.3K Star 8.1K Fork 4.3K

GVPMindSpore / mindspore

 / 详情

converter_lite 无法成功转换yoloV8模型

TODO
Bug-Report
创建于  
2024-04-14 15:02
name about labels
Bug Report Use this template for reporting a bug kind/bug

Describe the current behavior / 问题描述 (Mandatory / 必填)

mindspore lite converter 无法成功转换yoloV8模型

Environment / 环境信息 (Mandatory / 必填)

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:

Please delete the backend not involved / 请删除不涉及的后端:
/device CPU

  • Software Environment / 软件环境 (Mandatory / 必填):
    -- MindSpore version (e.g., 1.7.0.Bxxx) : lite 2.2.13
    -- Python version (e.g., Python 3.7.5) : 3.9.18
    -- OS platform and distribution (e.g., Linux Ubuntu 16.04): 22.04
    -- GCC/Compiler version (if compiled from source): No

  • Excute Mode / 执行模式 (Mandatory / 必填)(PyNative/Graph):

Please delete the mode not involved / 请删除不涉及的模式:
/mode mindspore lite

Related testcase / 关联用例 (Mandatory / 必填)

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. 使用yoloV8官方例程导出onnx【https://github.com/hero/YOLOv8】:
    from ultralytics import YOLO
    model = YOLO("yolov8n.yaml") # build a new model from scratch
    path = model.export(format="onnx") # export the model to ONNX format
  2. 下载linux版mindspore converter tools【https://www.mindspore.cn/lite/docs/zh-CN/r2.2/use/converter_tool.html】
  3. 配置环境后执行:converter_lite --fmk=ONNX --modelFile=yolov8n.onnx --outputFile=yolov8n --optimize=none

Describe the expected behavior / 预期结果 (Mandatory / 必填)

成功生成yolov8.ms文件

Related log / screenshot / 日志 / 截图 (Mandatory / 必填)

(base) xxxx:~/yolo_detect$ converter_lite --fmk=ONNX --modelFile=yolov8n.onnx --outputFile=yolov8n --optimize=none
[WARNING] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:21.806.879 [mindspore/lite/build/tools/converter/parser/onnx/onnx_op_parser.cc:5436] CheckOnnxModel] Can not find node input: of /model.10/Resize
[WARNING] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:21.806.907 [mindspore/lite/build/tools/converter/parser/onnx/onnx_op_parser.cc:5436] CheckOnnxModel] Can not find node input: of /model.13/Resize
[WARNING] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.431.747 [mindspore/lite/src/litert/infer_manager.cc:153] CheckInfershapeResult] Unexpected input format 0
[WARNING] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.431.764 [mindspore/lite/tools/optimizer/graph/node_infershape.cc:294] InferShapeByNNACL] InferShapeByNNACL for op: /model.22/dfl/conv/Conv failed.
[WARNING] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.431.770 [mindspore/lite/tools/optimizer/graph/infershape_pass.cc:314] InferProcess] node infer shape failed, node is /model.22/dfl/conv/Conv
[WARNING] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.431.783 [mindspore/lite/tools/optimizer/graph/infershape_pass.cc:189] Run] infer shape failed.
[WARNING] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.438.802 [mindspore/lite/src/litert/infer_manager.cc:153] CheckInfershapeResult] Unexpected input format 0
[WARNING] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.438.819 [mindspore/lite/tools/converter/legacy_optimizer/graph/infershape_pass.cc:629] InferSubgraph] InferShape failed, name: /model.22/dfl/conv/Conv, type: Conv2DFusion
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.438.824 [mindspore/lite/tools/converter/legacy_optimizer/graph/infershape_pass.cc:646] Run] InferSubgraph index: 0 failed, ret: -500
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.438.828 [mindspore/lite/tools/converter/optimizer.cc:78] Run] Run GraphPass failed
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.438.831 [mindspore/lite/tools/converter/graphdef_transform.cc:71] QuantTransform] Run quant_node_optimizer graphPasses Failed
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.438.843 [mindspore/lite/tools/converter/converter_metagraph.cc:102] Build] Transform meta graph failed -500
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.439.242 [mindspore/lite/tools/converter/converter.cc:1083] SaveGraph] Convert to meta graph failed
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.439.255 [mindspore/lite/tools/converter/converter.cc:1036] HandleGraphCommon] Save graph failed: -1 Common error code.
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.439.262 [mindspore/lite/tools/converter/converter.cc:980] Convert] Handle graph failed: -1 Common error code.
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.439.266 [mindspore/lite/tools/converter/converter.cc:1168] RunConverter] Convert model failed
[ERROR] LITE(614597,7f370fce1f40,converter_lite):2023-06-06-21:58:22.439.274 [mindspore/lite/tools/converter/cxx_api/converter.cc:374] Convert] Convert model failed, ret=Common error code.
ERROR [mindspore/lite/tools/converter/converter_lite/main.cc:104] main] Convert failed. Ret: Common error code.
Convert failed. Ret: Common error code.

Special notes for this issue/备注 (Optional / 选填)

评论 (2)

闫钰龙 创建了Bug-Report

Please assign maintainer to check this issue.
请为此issue分配处理人。
@fangwenyi @chengxiaoli @Shawny

感谢您的提问,您可以评论//mindspore-assistant更快获取帮助:

  1. 如果您刚刚接触MindSpore,或许您可以在教程找到答案
  2. 如果您是资深Pytorch用户,您或许需要:
  1. 如果您遇到动态图问题,可以设置set_context(pynative_synchronize=True)查看报错栈协助定位
  2. 模型精度调优问题可参考官网调优指南
  3. 如果您反馈的是框架BUG,请确认您在ISSUE中提供了MindSpore版本、使用的后端类型(CPU、GPU、Ascend)、环境、训练的代码官方链接以及可以复现报错的代码的启动方式等必要的定位信息
  4. 如果您已经定位出问题根因,欢迎提交PR参与MindSpore开源社区,我们会尽快review
Shawny 负责人设置为liuchengji
Shawny 关联项目设置为MindSpore Issue Assistant
Shawny 计划开始日期设置为2024-04-15
Shawny 计划截止日期设置为2024-05-15
Shawny 添加了
 
approved
标签
Shawny 移除了
 
approved
标签
Shawny 移除了
 
approved
标签
Shawny 添加了
 
approved
标签
Shawny 移除了
 
approved
标签
Shawny 添加了
 
approved
标签
Shawny 添加了
 
mindspore-assistant
标签
Shawny 移除了
 
approved
标签
Shawny 移除了
 
approved
标签
Shawny 添加了
 
approved
标签
Shawny 移除了
 
approved
标签
Shawny 移除了
 
mindspore-assistant
标签
Shawny 移除了
 
mindspore-assistant
标签
Shawny 添加了
 
sig/mslite
标签
Shawny 移除了
 
sig/mslite
标签
Shawny 移除了
 
sig/mslite
标签
Shawny 添加了
 
mindspore-assistant
标签
Shawny 添加了
 
sig/mslite
标签

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
2066750 larryyan 1578965474
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore

搜索帮助