Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.

Convert mobilenetv2-SSD model to IR

longhao1995
Beginner
449 Views

tensorflow:1.15   openvino:2019.3 

command:python mo_tf.py --input_model ssd/frozen_inference_graph.pb --data_type FP16 --tensorflow_use_custom_operations_config extensions/front/tf/ssd_v2_support.json --reverse_input_channels --tensorflow_object_detection_api_pipeline_config ssd/pipeline.config

The problem:[ ERROR ] Failed to match nodes from custom replacement description with id 'ObjectDetectionAPISSDPostprocessorReplacement':
It means model and custom replacement description are incompatible.
Try to correct custom replacement description according to documentation with respect to model node names
[ ERROR ] Cannot infer shapes or values for node "Postprocessor/Cast_1".
[ ERROR ] 0
[ ERROR ]
[ ERROR ] It can happen due to bug in custom shape infer function <function Cast.infer at 0x00000233344EBF28>.
[ ERROR ] Or because the node inputs have incorrect values/shapes.
[ ERROR ] Or because input shapes are incorrect (embedded to the model or passed via --input_shape).
[ ERROR ] Run Model Optimizer with --log_level=DEBUG for more information.
[ ERROR ] 0
Stopped shape/value propagation at "Postprocessor/Cast_1" node.
For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #38.
Exception occurred during running replacer "REPLACEMENT_ID" (<class 'extensions.middle.PartialInfer.PartialInfer'>): 0
Stopped shape/value propagation at "Postprocessor/Cast_1" node.
For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #38.

0 Kudos
2 Replies
Wan_Intel
Moderator
424 Views

Hi Longhao1995,

Thank you for reaching out to us.

 

Are you using ssd_mobilenet_v2_coco provided from Open Model Zoo?

 

I have validated the conversion of ssd_mobilenet_v2_coco with OpenVINO™ toolkit 2019.3.

 

Please install networkx version 2.3 before you convert the model:

pip install networkx==2.3

 

Please add these arguments when you execute mo_tf.py script:

 

python mo_tf.py --reverse_input_channels --input_shape=[1,300,300,3] --input=image_tensor --tensorflow_use_custom_operations_config=<INSTALL_DIR>/deployment_tools/model_optimizer/extensions/front/tf/ssd_v2_support.json --tensorflow_object_detection_api_pipeline_config=<path_to_ssd_mobilenet_v2_coco_dir>/ssd_mobilenet_v2_coco_2018_03_29/pipeline.config --output=detection_classes,detection_scores,detection_boxes,num_detections --input_model=<path_to_ssd_mobilenet_v2_coco_dir>/ssd_mobilenet_v2_coco_2018_03_29/frozen_inference_graph.pb

 

These arguments are also available here:

https://github.com/openvinotoolkit/open_model_zoo/blob/2019_R3.1/models/public/ssd_mobilenet_v2_coco/model.yml#L39

 

On the other hand, I would recommend you upgrade to the latest version of Intel® Distribution of OpenVINO™ toolkit 2021.3 for new capabilities and performance improvements.

 

 

Regards,

Wan


0 Kudos
Wan_Intel
Moderator
392 Views

Hi Longhao1995,


This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.



Regards,

Wan


0 Kudos
Reply