【发布时间】:2020-09-30 14:12:43
【问题描述】:
我已将(修改的)Darknet 模型转换为 onnx,(尝试过 opset 10 和 11),然后使用 this (at the bottom) 将此 onnx 模型转换为 IR
一切正常
C:\Program Files (x86)\IntelSWTools\openvino_2020.3.194\deployment_tools\model_optimizer>python mo.py --input_model C:\dev\yolo\weights\export.onnx --progress --output_dir C:\dev\yolo\weights\
Model Optimizer arguments:
Common parameters:
- Path to the Input Model: C:\dev\yolo\weights\export.onnx
- Path for generated IR: C:\dev\yolo\weights\
- IR output name: export
- Log level: ERROR
- Batch: Not specified, inherited from the model
- Input layers: Not specified, inherited from the model
- Output layers: Not specified, inherited from the model
- Input shapes: Not specified, inherited from the model
- Mean values: Not specified
- Scale values: Not specified
- Scale factor: Not specified
- Precision of IR: FP32
- Enable fusing: True
- Enable grouped convolutions fusing: True
- Move mean values to preprocess section: False
- Reverse input channels: False
ONNX specific parameters:
Model Optimizer version:
Progress: [....................] 100.00% done
[ SUCCESS ] Generated IR version 10 model.
[ SUCCESS ] XML file: C:\dev\yolo\weights\export.xml
[ SUCCESS ] BIN file: C:\dev\yolo\weights\export.bin
[ SUCCESS ] Total execution time: 10.24 seconds.
当我尝试使用 here 提供的 YOLO 示例加载此模型时,加载很好,但是当我在调试模式下检查网络对象时,我看到输出是
Transpose_231、Transpose_237 和 Slice_230/Split.1。
当我检查图层时,我看到它包含Transpose_231、Transpose_237 和Slice_230/Split(注意,在拆分中缺少.1)
这会导致样本失败,KeyError: 'Slice_230/Split.1' in
for layer_name, out_blob in output.items():
out_blob = out_blob.buffer.reshape(net.layers[net.layers[layer_name].parents[0]].out_data[0].shape)
如果我检查 IR 的 .XML 文件,我在其中看不到任何 .1
<layer id="214" name="Slice_230/Split" type="VariadicSplit" version="opset1">
<input>
<port id="0">
<dim>6</dim>
<dim>142191</dim>
</port>
<port id="1"/>
<port id="2">
<dim>3</dim>
</port>
</input>
<output>
<port id="3" precision="FP32">
<dim>4</dim>
<dim>142191</dim>
</port>
<port id="4" precision="FP32">
<dim>1</dim>
<dim>142191</dim>
</port>
<port id="5" precision="FP32">
<dim>1</dim>
<dim>142191</dim>
</port>
</output>
</layer>
这个.1 来自哪里的任何建议?
编辑
尝试使用 opset 9,同样的事情发生在这次使用 Slice_174/Split 和 Slice_174/Split.1
【问题讨论】: