提取属性Open Vino时发生意外异常

问题描述 投票:0回答:1

我正在尝试使用mo_caffe.py脚本转换Caffe模型。我总是收到以下错误,但是在随机节点中(都具有通用的“ BatchNorm” op)。使用Nvidia-Digits(https://github.com/NVIDIA/DIGITS

训练模型
Model Optimizer arguments:
Common parameters:
        - Path to the Input Model:      /home/deploy.caffemodel
        - Path for generated IR:        /dldt/model-optimizer/.
        - IR output name:       deploy
        - Log level:    INFO
        - 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
Caffe specific parameters:
        - Path to Python Caffe* parser generated from caffe.proto:      mo/front/caffe/proto
        - Enable resnet optimization:   True
        - Path to the Input prototxt:   /home/deploy.prototxt
        - Path to CustomLayersMapping.xml:      Default
        - Path to a mean file:  Not specified
        - Offsets for a mean file:      Not specified
Model Optimizer version:        unknown version
[ INFO ]  Importing extensions from: /dldt/model-optimizer/mo
[ INFO ]  New subclass: <class 'mo.ops.crop.Crop'>
[ INFO ]  Registered a new subclass with key: Crop
[ INFO ]  New subclass: <class 'mo.ops.deformable_convolution.DeformableConvolution'>
[ INFO ]  Registered a new subclass with key: DeformableConvolution
[ INFO ]  New subclass: <class 'mo.ops.concat.Concat'>
[ INFO ]  Registered a new subclass with key: Concat
[ INFO ]  New subclass: <class 'mo.ops.split.Split'>
...
Some log info. I don't think anything interesting here.
...
[ WARNING ]  Skipped <class 'extensions.front.override_batch.OverrideBatch'> registration because it was already registered or it was disabled.
[ WARNING ]  Skipped <class 'extensions.front.TopKNormalize.TopKNormalize'> registration because it was already registered or it was disabled.
[ WARNING ]  Skipped <class 'extensions.front.reshape_dim_normalizer.ReshapeDimNormalizer'> registration because it was already registered or it was
disabled.
[ WARNING ]  Skipped <class 'extensions.front.ArgMaxSqueeze.ArgMaxSqueeze'> registration because it was already registered or it was disabled.
[ WARNING ]  Skipped <class 'extensions.front.standalone_const_eraser.StandaloneConstEraser'> registration because it was already registered or it wa
s disabled.
[ WARNING ]  Skipped <class 'extensions.front.TransposeOrderNormalizer.TransposeOrderNormalizer'> registration because it was already registered or i
t was disabled.
[ WARNING ]  Skipped <class 'mo.front.common.replacement.FrontReplacementOp'> registration because it was already registered or it was disabled.
[ WARNING ]  Skipped <class 'extensions.front.restore_ports.RestorePorts'> registration because it was already registered or it was disabled.
[ WARNING ]  Skipped <class 'extensions.front.softmax.SoftmaxFromKeras'> registration because it was already registered or it was disabled.
[ WARNING ]  Skipped <class 'extensions.front.reduce_axis_normalizer.ReduceAxisNormalizer'> registration because it was already registered or it was
disabled.
[ WARNING ]  Skipped <class 'extensions.front.freeze_placeholder_value.FreezePlaceholderValue'> registration because it was already registered or it
was disabled.
[ WARNING ]  Skipped <class 'extensions.front.no_op_eraser.NoOpEraser'> registration because it was already registered or it was disabled.
[ WARNING ]  Node attributes: {'_in_ports': {}, 'model_pb': name: "conv2_3_sep_bn_left"
type: "BatchNorm"
bottom: "conv2_3_sep_left"
top: "conv2_3_sep_left"
param {
  lr_mult: 0.0
  decay_mult: 0.0
}
param {
  lr_mult: 0.0
  decay_mult: 0.0
}
param {
  lr_mult: 0.0
  decay_mult: 0.0
}
blobs {                                                                                                                                      [0/1963]
  shape {
    dim: 32
  }
}
blobs {
  shape {
    dim: 32
  }
}
blobs {
  shape {
    dim: 1
  }
}
phase: TRAIN
, 'kind': 'op', '_out_ports': {}, 'pb': name: "conv2_3_sep_bn_left"
type: "BatchNorm"
bottom: "conv2_3_sep_left"
top: "conv2_3_sep_left"
param {
  lr_mult: 0.0
  decay_mult: 0.0
}
param {
  lr_mult: 0.0
  decay_mult: 0.0
}
param {
  lr_mult: 0.0
  decay_mult: 0.0
}
, 'type': 'Parameter'}
[ ERROR ]  Unexpected exception happened during extracting attributes for node relu1.
Original exception message: list index (0) out of range

这是我收到的错误消息。我还创建了一个GitHub issue

Here是我要从Caffe转换为OpenVino的模型

machine-learning deep-learning computer-vision caffe openvino
1个回答
0
投票

问题是Nvidia-Digits使用定制的Caffe的分叉版本。这就是为什么OpenVino无法正确读取模型权重的原因。

在使用OpenVino进行转换之前,我必须使用this脚本来转换模型。

© www.soinside.com 2019 - 2024. All rights reserved.