首页 > 解决方案 > 使用 MVN 操作编译 InferenceEngine Openvino 失败

问题描述

我正在将MBART模型从 HuggingFace Transformer 转换为 OpenVino IF 格式,并且我已经“成功”地将原始 pytorch 模型图分解为 3 个单独的 ONNX 模型。然后,我使用mo.py将 onnx 模型转换为 IF 格式模型,以在 openvino 中为“MYRIAD”神经计算棒 2 使用推理引擎。它本质上是两个编码器和一个解码器。我正在尝试测试第一个编码器模型,以查看简单的推理引擎负载是否有效。

我收到以下错误:

[ INFO ] Loading Inference Engine
[ INFO ] Loading network:
[ INFO ]     c:\protoc\models\translator\encoder\model.xml
[ INFO ] Device info:
[ INFO ]         MYRIAD
[ INFO ]         MKLDNNPlugin version ......... 2.1
[ INFO ]         Build ........... 2021.3.0-2774-d6ebaa2cd8e-refs/pull/4731/head
[ INFO ] Inputs number: 2
[ INFO ]     Input name: attention_mask
[ INFO ]     Input shape: [1, 92]
....

RuntimeError: Failed to compile layer "Div_25": Unsupported combination of indices in layer "Div_25". Only accross channel and full batch supported.

我检查了Div_25图层,它看起来像:


<layer id="30" name="Div_25" type="MVN" version="opset6">
            <data eps="9.999999747378752e-06" eps_mode="inside_sqrt" normalize_variance="true"/>
            <input>
                <port id="0">
                    <dim>1</dim>
                    <dim>92</dim>
                    <dim>1024</dim>
                </port>
                <port id="1">
                    <dim>1</dim>
                </port>
            </input>
            <output>
                <port id="2" precision="FP32" names="231">
                    <dim>1</dim>
                    <dim>92</dim>
                    <dim>1024</dim>
                </port>
            </output>
        </layer>

阅读MVN文档,并尝试在不走运的情况下将各种值port id="1"置于暗淡之下。不幸的是,我不完全理解它警告我要修复它的内容。

标签: machine-translationopenvino

解决方案


OpenVINO 似乎还不支持您与 Div_25 层一起使用的 ONNX 模型。您可以参考Supported Framework 层上的这些文档。


推荐阅读