モデル・オプティマイザーを使用してカスタム SSD MobileNet V2 モデルを IR に変換する手順
事前トレーニング済みの SSD MobileNetV2 モデルを IR に変換しましたが、カスタムトレーニング済みモデルを変換できません。
- エクスポートされた冷凍モデルグラフ:
python object_detection/export_inference_graph.py \ --input_type=image_tensor \ --pipeline_config_path={PIPELINE_CONFIG_PATH} \ --output_directory="exported_model" \ --trained_checkpoint_prefix="/content/models/research/helmet_detector/model.ckpt-10000"
- モデル・オプティマイザーを使用して冷凍モデルグラフを IR に変換試行:
python mo_tf.py \ --input_model ./exported_model/frozen_inference_graph.pb \ --tensorflow_use_custom_operations_config extensions/front/tf/ssd_v2_support.json \ --tensorflow_object_detection_api_pipeline_config ./helment_detector_tf1.config \ --input_shape [1,300,300,3] \ --reverse_input_channels \ --output_dir output_ncs \ --data_type FP16
- エラーが発生しました:
[ エラー ]置換器「REPLACEMENT_ID」の実行中に例外が発生しました (): ノードの属性を抽出中に予期しない例外が発生しました StatefulPartitionedCall/Postprocessor/BatchMultiClassNonMaxSuppression/map/while。元の例外メッセージ: '^Postprocessor/BatchMultiClassNonMaxSuppression/map/while/MultiClassNonMaxSuppression/SortByField/Assert/Assert'
モデル・オプティマイザーの変換コマンドで、TensorFlow* 1 モデルで生成された SSD MobileNetV2 モデルに適切なカスタム・オペレーション構成ファイル ( ssd_support_api_v1.15.json) を使用します。変換手順については、次のページを 参照してください : モデルを変換する方法
python3 ./openvino/model-Optimizer/mo_tf.py --input_model ./detector/exported_model/frozen_inference_graph.pb --tensorflow_use_custom_operations_config ./openvino/model-Optimizer/extensions/front/tf/ssd_support_api_v1 helment_detector_tf1.15.json --tensorflow_object_detection_api_pipeline_config ./detector/helment_detector_tf1.config --input_shape [1,300,300,3] --reverse_input_channels --data_type FP16