文章 ID: 000058700 内容类型: 故障排除 上次审核日期: 2022 年 05 月 20 日

将自定义训练的固态盘 MobileNetV2 转换为中间表示 (IR) 时,在运行替换器“REPLACEMENT_ID”时发生异常错误

环境

开源OpenVINO™工具套件 2021.2 TensorFlow* 2.2 TensorFlow 1.15

BUILT IN - ARTICLE INTRO SECOND COMPONENT
总结

使用模型优化器将自定义固态盘 MobileNet V2 模型转换为 IR 的步骤

说明

将预先训练的固态盘 MobileNetV2 模型转换为 IR,但无法转换经过自定义训练的模型。

  1. 导出的冻结模型图:

    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”

  2. 试图使用模型优化器将冻结的模型图转换为 IR:

    python mo_tf.py \ --input_model ./exported_model/frozen_inference_graph.pb \ --tensorflow_use_custom_operations_config 扩展/front/tf/ssd_v2_support.json \ --tensorflow_object_detection_api_pipeline_config tensorflow_use_custom_operations_config ./helment_detector_tf1.config \ --input_shape [1,300,300,3] \ --reverse_input_channels \ --output_dir output_ncs \ --data_type FP16

  3. 遇到错误:

    [ 错误 ]在运行替换器“REPLACEMENT_ID”期间发生异常():在解压节点 StatefulPartedCall/Postprocesor/BatchMultiClassBatMaxSuppression/map/时发生意外异常。原始例外消息:'^后处理器/BatchMultiClassMaxSuppression/map/while/MultiClassBatMaxsuppression/SortByField/Assert/Assert'

解决方法

在模型优化器转换命令中,为使用 TensorFlow* 1 模型生成的固态盘 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.15.json --tensorflow_object_detection_api_pipeline_config ./探测器/helment_detector_tf1.config --input_shape [1,300,300,3] --reverse_input_channels --data_type FP16

相关产品

本文适用于 2 产品

本页面上的内容是原始英文内容的人工翻译与计算机翻译的组合。我们提供此内容是为了您的便利并且仅供参考,未必完整或准确。如果本页面的英文版与翻译版之间存在任何冲突,应以英文版为准。 查看此页面的英语版本。