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.
6404 Discussions

Trying with no success to use model optimizer to convert tensorflow graph

Supra__Morne_
Beginner
2,424 Views

Hi

I have been trying for days now to convert a tensorflow graph to use with Neural compute stick2.

I even re-created a VM to use the latest version of the openvino toolkit dated 01 April 2019.

I run the following command:

python3 /opt/intel/openvino/deployment_tools/model_optimizer/mo.py --input_model inference_graph/frozen_inference_graph.pb --tensorflow_use_custom_operations_config /opt/intel/openvino_2019.1.094/deployment_tools/model_optimizer/extensions/front/tf/faster_rcnn_support_api_v1.10.json --tensorflow_object_detection_api_pipeline_config /home/msupra/supra-detect/models/research/object_detection/inference_graph/pets.config --reverse_input_channels --data_type FP16 --output_dir /tmp/

 

The error output:

[ WARNING ] Model Optimizer removes pre-processing block of the model which resizes image keeping aspect ratio. The Inference Engine does not support dynamic image size so the Intermediate Representation file is generated with the input image size of a fixed size.
Specify the "--input_shape" command line parameter to override the default shape which is equal to (600, 600).
The Preprocessor block has been removed. Only nodes performing mean value subtraction and scaling (if applicable) are kept.
[ ERROR ]  Exception occurred during running replacer "ObjectDetectionAPIDetectionOutputReplacement" (<class 'extensions.front.tf.ObjectDetectionAPI.ObjectDetectionAPIDetectionOutputReplacement'>): Found the following nodes '[]' with name 'crop_proposals' but there should be exactly 1. Looks like ObjectDetectionAPIProposalReplacement replacement didn't work.

 

I have searched the internet for a solution, but have not been able to find a working solution. Please help me to get this self trained model converted to openvino.

 

Regards

Morne

0 Kudos
28 Replies
Shubha_R_Intel
Employee
448 Views

Dear Supra, Morne, 

I'm sorry but what store-traffic-monitor sample are you talking about ?  Here is the current list of OpenVino samples:

https://docs.openvinotoolkit.org/latest/_docs_IE_DG_Samples_Overview.html

Also there is no such thing as object_counter.py in the OpenVino distribution.

Thanks,

Shubha

0 Kudos
Supra__Morne_
Beginner
448 Views

Hi Shubha

Here is the link to the store traffic monitor:

https://github.com/intel-iot-devkit/store-traffic-monitor-python

 

object_counter.py is just my renamed file of the store-traffic-monitor.py file, as I use my own model to detect and track other self trained objects.

Regards

Morne

0 Kudos
Shubha_R_Intel
Employee
448 Views

Dear Morne,

I have a fix for you. Unzip the attached and drop the *.json files into C:\Program Files (x86)\IntelSWTools\openvino_2019.1.133\deployment_tools\model_optimizer\extensions\front\tf (or the Linux variant). Try it again. This time it will work !

Thanks,

Shubha

0 Kudos
Supra__Morne_
Beginner
448 Views

Hi Shubha

Thanks for the fix, but do you maybe have a fix for linux? I do not use windows.

Regards

Morne

0 Kudos
Ahmed_Gaber
Beginner
448 Views

Hello,

I have similar problem Iam using faster_rcnn_inception_v2_coco  and got the same error.

I used the tf_obj_det_json 1.13 that @shubha attached but didn't work

 

I used openvino R4 and R5 1.0 and R5 1.1 

on linux 1.16

 

 

0 Kudos
Shubha_R_Intel
Employee
448 Views

Dear folks, that fix I provided is OS agnostic - the zip file contains 2 *.json files. Kindly remember that Model Optimizer is written in Python - so it works on any OS just as is. Everyone, please kindly upgrade to the latest 2019R1.1 which was just released.

Thanks for using OpenVino !

Shubha

0 Kudos
CBell1
New Contributor II
448 Views

Hi Shubha,

I hope you are well!

I'm working on to create a fruits custom classification following the OpenVino guide at the link beow: 

https://software.intel.com/en-us/articles/fruit-classification-prototype

I correctly executed all steps excepted the convertion of the TensorFlow model into IR format (as usual it seems the most delicate part of OV):

OS: Ubutu 16.04

Python 3.5.2

OpenVino version: openvino_2019.1.144

Executed command:

$ sudo python3 mo_tf.py --input_model "/home/cosma/Development/venvov/dataset/train/fruits_faster_rcnn_inception_inference_graph/frozen_inference_graph.pb" --tensorflow_use_custom_operations_config "/opt/intel/openvino_2019.1.144/deployment_tools/model_optimizer/extensions/front/tf/faster_rcnn_support_api_v1.13.json" --tensorflow_object_detection_api_pipeline_config "/home/cosma/Development/venvov/dataset/train/fruits_faster_rcnn_inception_inference_graph/pipeline.config"

Output with error message:

[ WARNING ] Model Optimizer removes pre-processing block of the model which resizes image keeping aspect ratio. The Inference Engine does not support dynamic image size so the Intermediate Representation file is generated with the input image size of a fixed size.
Specify the "--input_shape" command line parameter to override the default shape which is equal to (600, 600).
The Preprocessor block has been removed. Only nodes performing mean value subtraction and scaling (if applicable) are kept.
WARNING: Logging before flag parsing goes to stderr.
E1030 08:24:59.476070 140452707170048 main.py:317] Exception occurred during running replacer "ObjectDetectionAPIDetectionOutputReplacement" (<class 'extensions.front.tf.ObjectDetectionAPI.ObjectDetectionAPIDetectionOutputReplacement'>): Found the following nodes '[]' with name 'crop_proposals' but there should be exactly 1. Looks like ObjectDetectionAPIProposalReplacement replacement didn't work.

Using faster_rcnn_support_api_v1.10.json  or  faster_rcnn_support_api_v1.7.json I experience the same error.

Please, do you have some suggestions?

Do I have to downgrade OV from openvino_2019.1.144 to 1.133 ?

If yes, where I can find the download link?

Thank you

 

 

 

0 Kudos
V__Harikumar
Beginner
448 Views

Hi Team,

Is there any update on this issue. I tried using tf_obj_det_jsons.zip , but still getting same error , ie
'Exception occurred during running replacer "ObjectDetectionAPIDetectionOutputReplacement" (<class 'extensions.front.tf.ObjectDetectionAPI.ObjectDetectionAPIDetectionOutputReplacement'>): Found the following nodes '[]' with name 'crop_proposals' but there should be exactly 1. Looks like ObjectDetectionAPIProposalReplacement replacement didn't work.'

0 Kudos
Reply