我问这个问题是因为我想解决我遇到的错误。
我想在 Raspberry Pi 3 B+ 和 NCS(不是 2,它是 NCS1)中使用“SSD lite Mobilenet V2”。
所以我在我的 Pi(Raspbian 拉伸)和笔记本电脑(Linux,不是所有程序,只是模型优化器)上安装了 OpenVINO 2019_R3。
当我优化 SSD lite mobilenet v2(训练有素的动物园模型)时,它很好。
因此,我使用 Tensorflow 对象检测 API 在 Google Colab 中训练了我的模型。
但是当我优化我自己的 SSD lite 模型时,这里是日志和我输入到 shell 的内容。
sudo python3 mo_tf.py --input_model frozen_inference_graph.pb --tensorflow_use_custom_operations_config ssd_support_api_v1.14.json --tensorflow_object_detection_api_pipeline_config pipeline.config --reverse_input_channels --data_type FP16 --keep_shape_ops
[ WARNING ] Use of deprecated cli option --disable_fusing detected. Option use in the following releases will be fatal. Please use --finegrain_fusing cli option instead
Model Optimizer arguments:
Common parameters:
- Path to the Input Model: /opt/intel/openvino_2019.3.334/deployment_tools/model_optimizer/frozen_inference_graph.pb
- Path for generated IR: /opt/intel/openvino_2019.3.334/deployment_tools/model_optimizer/.
- IR output name: frozen_inference_graph
- 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: FP16
- Enable fusing: False
- Enable grouped convolutions fusing: True
- Move mean values to preprocess section: False
- Reverse input channels: True
TensorFlow specific parameters:
- Input model in text protobuf format: False
- Path to model dump for TensorBoard: None
- List of shared libraries with TensorFlow custom layers implementation: None
- Update the configuration file with input/output node names: None
- Use configuration file used to generate the model with Object Detection API: /opt/intel/openvino_2019.3.334/deployment_tools/model_optimizer/pipeline.config
- Operations to offload: None
- Patterns to offload: None
- Use the config file: /opt/intel/openvino_2019.3.334/deployment_tools/model_optimizer/ssd_support_api_v1.14.json
Model Optimizer version: 2019.3.0-375-g332562022
The Preprocessor block has been removed. Only nodes performing mean value subtraction and scaling (if applicable) are kept.
[ ERROR ] List of operations that cannot be converted to Inference Engine IR:
[ ERROR ] FusedBatchNormV3 (76)
[ ERROR ] FeatureExtractor/MobilenetV2/Conv/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_1/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_1/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_1/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_2/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_2/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_3/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_3/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_3/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_4/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_4/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_4/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_5/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_5/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_5/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_6/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_6/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_6/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_7/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_7/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_7/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_8/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_8/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_8/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_9/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_9/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_9/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_10/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_10/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_10/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_11/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_11/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_11/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_12/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_12/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_12/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_13/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_0/BoxEncodingPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_13/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_13/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_14/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_14/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_14/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_15/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_15/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_15/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_16/expand/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_16/depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/expanded_conv_16/project/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/Conv_1/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_1/BoxEncodingPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_1_Conv2d_2_1x1_256/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_2_Conv2d_2_3x3_s2_512_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_2_Conv2d_2_3x3_s2_512/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_2/BoxEncodingPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_1_Conv2d_3_1x1_128/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_2_Conv2d_3_3x3_s2_256_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_2_Conv2d_3_3x3_s2_256/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_3/BoxEncodingPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_1_Conv2d_4_1x1_128/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_2_Conv2d_4_3x3_s2_256_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_2_Conv2d_4_3x3_s2_256/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_4/BoxEncodingPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_1_Conv2d_5_1x1_64/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_2_Conv2d_5_3x3_s2_128_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] FeatureExtractor/MobilenetV2/layer_19_2_Conv2d_5_3x3_s2_128/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_5/BoxEncodingPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_0/ClassPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_1/ClassPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_2/ClassPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_3/ClassPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_4/ClassPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] BoxPredictor_5/ClassPredictor_depthwise/BatchNorm/FusedBatchNormV3
[ ERROR ] Part of the nodes was not converted to IR. Stopped.
For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_...), question #24.
我猜想使用“FusedBatchNormV3”会有问题。Tensorflow 1.15.0-rc0 安装在笔记本电脑和 colab 中。
所以我改变了 Colab 和笔记本电脑的 Tensorflow 版本(从 1.15 到 1.14),但问题仍然存在。
有什么方法可以关闭 FusedBatchNormV3 吗?(我认为 OpenVINO R3 不支持)
这是 pipeline.config 文件。
model {
ssd {
num_classes: 7
image_resizer {
fixed_shape_resizer {
height: 300
width: 300
}
}
feature_extractor {
type: "ssd_mobilenet_v2"
depth_multiplier: 1.0
min_depth: 16
conv_hyperparams {
regularizer {
l2_regularizer {
weight: 3.99999989895e-05
}
}
initializer {
truncated_normal_initializer {
mean: 0.0
stddev: 0.0299999993294
}
}
activation: RELU_6
batch_norm {
decay: 0.999700009823
center: true
scale: true
epsilon: 0.0010000000475
train: true
}
}
use_depthwise: true
}
box_coder {
faster_rcnn_box_coder {
y_scale: 10.0
x_scale: 10.0
height_scale: 5.0
width_scale: 5.0
}
}
matcher {
argmax_matcher {
matched_threshold: 0.5
unmatched_threshold: 0.5
ignore_thresholds: false
negatives_lower_than_unmatched: true
force_match_for_each_row: true
}
}
similarity_calculator {
iou_similarity {
}
}
box_predictor {
convolutional_box_predictor {
conv_hyperparams {
regularizer {
l2_regularizer {
weight: 3.99999989895e-05
}
}
initializer {
truncated_normal_initializer {
mean: 0.0
stddev: 0.0299999993294
}
}
activation: RELU_6
batch_norm {
decay: 0.999700009823
center: true
scale: true
epsilon: 0.0010000000475
train: true
}
}
min_depth: 0
max_depth: 0
num_layers_before_predictor: 0
use_dropout: false
dropout_keep_probability: 0.800000011921
kernel_size: 3
box_code_size: 4
apply_sigmoid_to_scores: false
use_depthwise: true
}
}
anchor_generator {
ssd_anchor_generator {
num_layers: 6
min_scale: 0.20000000298
max_scale: 0.949999988079
aspect_ratios: 1.0
aspect_ratios: 2.0
aspect_ratios: 0.5
aspect_ratios: 3.0
aspect_ratios: 0.333299994469
}
}
post_processing {
batch_non_max_suppression {
score_threshold: 0.300000011921
iou_threshold: 0.600000023842
max_detections_per_class: 100
max_total_detections: 100
}
score_converter: SIGMOID
}
normalize_loss_by_num_matches: true
loss {
localization_loss {
weighted_smooth_l1 {
}
}
classification_loss {
weighted_sigmoid {
}
}
hard_example_miner {
num_hard_examples: 3000
iou_threshold: 0.990000009537
loss_type: CLASSIFICATION
max_negatives_per_positive: 3
min_negatives_per_image: 3
}
classification_weight: 1.0
localization_weight: 1.0
}
}
}
train_config {
batch_size: 32
data_augmentation_options {
random_horizontal_flip {
}
}
data_augmentation_options {
ssd_random_crop {
}
}
optimizer {
rms_prop_optimizer {
learning_rate {
exponential_decay_learning_rate {
initial_learning_rate: 0.00400000018999
decay_steps: 800720
decay_factor: 0.949999988079
}
}
momentum_optimizer_value: 0.899999976158
decay: 0.899999976158
epsilon: 1.0
}
}
fine_tune_checkpoint: "/content/confg_ssd2/model.ckpt"
num_steps: 200000
fine_tune_checkpoint_type: "detection"
}
train_input_reader {
label_map_path: "/content/confg_ssd2/mscoco_label_map.pbtxt"
tf_record_input_reader {
input_path: "/content/confg_ssd2/mscoco_train.record"
}
}
eval_config {
num_examples: 8000
max_evals: 10
use_moving_averages: false
}
eval_input_reader {
label_map_path: "/content/confg_ssd2/mscoco_label_map.pbtxt"
shuffle: false
num_readers: 1
tf_record_input_reader {
input_path: "/content/confg_ssd2/mscoco_val.record"
}
}