Article ID: 000094699 Content Type: Troubleshooting Last Reviewed: 05/12/2023

Unable to Convert Custom TensorFlow* 2.0 into IR

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Commands to convert Tensorflow* Saved Model Format into dynamic shaped IR

Description

Failed to convert a retrained TF OD API Mask RCNN model, which works on GPU using the commands below:

mo \
> --saved_model_dir '<DIR_TF_model>/Tensorflow-Object-Detection-API-train-custom-Mask-R-CNN-model-master/inference_graph/saved_model' \
> --transformations_config '<DIR_OV>/openvino_env/lib/python3.7/site-packages/openvino/tools/mo/front/tf/mask_rcnn_support_api_v2.0.json' \
> --tensorflow_object_detection_api_pipeline_config '<DIR_TF>/Tensorflow-Object-Detection-API-train-custom-Mask-R-CNN-model-master/inference_graph/pipeline.config' \
> --reverse_input_channels

Encountered error:

[ ERROR ] Exception occurred during running replacer "ObjectDetectionAPIPreprocessor2Replacement (<class 'openvino.tools.mo.front.tf.ObjectDetectionAPI.ObjectDetectionAPIPreprocessor2Replacement'>)

Resolution

Use the conversion command below:

 mo --saved_model_dir "savedmodelpath\saved_model" --input_shape [1, -1, -1, 3]

Test inferencing with benchmark_app:

benchmark_app -m savedmodelpath\saved_model.xml -data_shape [1,5,4,3]

Additional information

Refer to Converting a TensorFlow Model

Related Products

This article applies to 1 products