跳转至主要内容
支持知识库

将 YOLOv5 ONNX 模型转换为中间表示 (IR) 格式时,收到与节点相关的错误

内容类型: 错误讯息   |   文章 ID: 000088394   |   上次审核日期: 2022 年 05 月 20 日

说明

  • 将 YOLOv5 ONNX 模型转换为 IR 格式:

    python /opt/intel/openvino_2021/deployment_tools/model_optimizer/mo.py --input_model "model.onnx" --output_dir  "cur_folder/"

  • 收到错误:

    [ ERROR ] The ExpandDims node Unsqueeze_583 has more than 1 input
    [ ERROR ] Cannot infer shapes or values for node "Slice_4".
    [ ERROR ] Output shape: [0 3 0 0] of node "Slice_4" contains non-positive values
    [ ERROR ] It can happen due to bug in custom shape infer function .
    [ ERROR ] Or because the node inputs have incorrect values/shapes.
    [ ERROR ] Or because input shapes are incorrect (embedded to the model or passed via --input_shape).

解决方法

YOLOv5 中有三个输出节点,所有节点都需要在命令中指定:

模型优化器命令: python mo.py --input_model model.onnx --output --input_shape [1,3,512,512]

其他信息:

使用 Netron 可视化 YOLOv5 ONNX 重量。

相关产品

本文适用于 4 产品。
英特尔® 至强融核™ 处理器软件 OpenVINO™ toolkit 性能函数库

停产的产品

英特尔® DevCloud for the Edge

免责声明

本页面上的内容是原始英文内容的人工翻译与计算机翻译的组合。我们提供此内容是为了您的便利并且仅供参考,未必完整或准确。如果本页面的英文版与翻译版之间存在任何冲突,应以英文版为准。 查看此页面的英语版本。