Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Patel__Nakuldev
Beginner
255 Views

Tensorflow Object Detection API - rfcn_resnet101_coco - Model Optimizer Issue

Jump to solution
Model: Transfer Learning on top of (https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md) Command: python mo_tf.py --input_model="E:\frozen_inference_graph.pb" --tensorflow_use_custom_operations_config="C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\extensions\front\tf\rfcn_support_api_v1.10.json" --tensorflow_object_detection_api_pipeline_config="E:\pipeline.config" Error: Model Optimizer version: 2019.1.1-83-g28dfbfd [ 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. E0620 17:00:08.224401 18980 main.py:323] ------------------------------------------------- E0620 17:00:08.226389 18980 main.py:324] ----------------- INTERNAL ERROR ---------------- E0620 17:00:08.227380 18980 main.py:325] Unexpected exception happened. E0620 17:00:08.228379 18980 main.py:326] Please contact Model Optimizer developers and forward the following information: E0620 17:00:08.228379 18980 main.py:327] Exception occurred during running replacer "ObjectDetectionAPIPSROIPoolingReplacement ()": Attempt to access node proposals that not in graph E0620 17:00:08.233377 18980 main.py:328] Traceback (most recent call last): File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo\utils\class_registration.py", line 167, in apply_replacements replacer.find_and_replace_pattern(graph) File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo\front\tf\replacement.py", line 89, in find_and_replace_pattern self.replace_sub_graph(graph, match) File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo\front\common\replacement.py", line 131, in replace_sub_graph new_sub_graph = self.generate_sub_graph(graph, match) # pylint: disable=assignment-from-no-return File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\extensions\front\tf\ObjectDetectionAPI.py", line 1064, in generate_sub_graph swap_proposals_node = add_convolution_to_swap_xy_coordinates(graph, Node(graph, 'proposals'), 5) File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo\graph\graph.py", line 36, in __init__ raise AttributeError("Attempt to access node {} that not in graph".format(node)) AttributeError: Attempt to access node proposals that not in graph The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo\main.py", line 312, in main return driver(argv) File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo\main.py", line 263, in driver is_binary=not argv.input_model_is_text) File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo\pipeline\tf.py", line 127, in tf2nx class_registration.apply_replacements(graph, class_registration.ClassType.FRONT_REPLACER) File "C:\Program Files (x86)\IntelSWTools\openvino\deployment_tools\model_optimizer\mo\utils\class_registration.py", line 190, in apply_replacements )) from err Exception: Exception occurred during running replacer "ObjectDetectionAPIPSROIPoolingReplacement ()": Attempt to access node proposals that not in graph E0620 17:00:08.241390 18980 main.py:329] ---------------- END OF BUG REPORT -------------- E0620 17:00:08.242370 18980 main.py:330] -------------------------------------------------
0 Kudos
1 Solution
Shubha_R_Intel
Employee
255 Views

Dear Patel, Nakuldev

 Please use rfcn_support_api_v1.13.json from the attached zip and it will work. By the way I'm on Tensorflow 1.12.

Thanks for your patience !

Shubha

View solution in original post

9 Replies
Shubha_R_Intel
Employee
255 Views

Dear Patel, Nakuldev,

Indeed the Tensorflow Object Detection APIs underwent a lot of changes lately so several of the *.json under deployment_tools\model_optimizer\mo\front\tf don't work anymore. Can you kindly attach your custom trained frozen.pb and your pipeline config as a zip attachment to this forum ticket ?

I will take care of it promptly.

Thanks,

Shubha

Patel__Nakuldev
Beginner
255 Views
Thanks Shubha, Attached zip contains frozen model and associated pipeline.config
Shubha_R_Intel
Employee
255 Views

Dear Patel, Nakuldev,

Thanks ! I have downloaded your zip file and I will investigate your issue.

Sincerely,

Shubha

 

Shubha_R_Intel
Employee
256 Views

Dear Patel, Nakuldev

 Please use rfcn_support_api_v1.13.json from the attached zip and it will work. By the way I'm on Tensorflow 1.12.

Thanks for your patience !

Shubha

View solution in original post

Patel__Nakuldev
Beginner
255 Views
Thanks Shubha R. It did work this time. I have another query, do we have inferencing engine example code for RFCN based object detection?
Shubha_R_Intel
Employee
255 Views

Dear Patel, Nakuldev,

For RFCN based object detection, please try the object detection demo (not SSD)

Hope it helps. And I am glad that  rfcn_support_api_v1.13.json worked fine for you in the Model Optimizer command.

Thanks,

Shubha

 

King__Hesper
Beginner
255 Views

Hi, I have the same issue as you, my command is

/opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/mo_tf.py --input_model frozen_inference_graph2017.pb --tensorflow_use_custom_operations_config /home/smc/hongxing/demos/models/rfcn_resnet101_coco_2018_01_28/tf_obj_det_jsons2/rfcn_support_api_v1.10.json --tensorflow_object_detection_api_pipeline_config pipeline.config --reverse_input_channels --data_type=FP32 --input_shape=[1,600,600,3]

and got the ERROR info:

[ ERROR ]  Exception occurred during running replacer "ObjectDetectionAPIDetectionOutputReplacement" (<class 'extensions.front.tf.ObjectDetectionAPI.ObjectDetectionAPIDetectionOutputReplacement'>): Found the following nodes '[]' with name 'proposals' but there should be exactly 1. Looks like ObjectDetectionAPIProposalReplacement replacement didn't work.

Process finished with exit code 1
 

Could you please help me the solve this problem?

King__Hesper
Beginner
255 Views

Hi, I got the similar issue as you , when I optimized my RFCN model with  the mo_tf.py

/opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/mo_tf.py --input_model frozen_inference_graph2017.pb --tensorflow_use_custom_operations_config /home/smc/hongxing/demos/models/rfcn_resnet101_coco_2018_01_28/tf_obj_det_jsons2/rfcn_support_api_v1.13.json --tensorflow_object_detection_api_pipeline_config pipeline.config --reverse_input_channels --data_type=FP32 --input_shape=[1,600,600,3]

 

I got this:

 

[ ERROR ]  Exception occurred during running replacer "ObjectDetectionAPIDetectionOutputReplacement" (<class 'extensions.front.tf.ObjectDetectionAPI.ObjectDetectionAPIDetectionOutputReplacement'>): Found the following nodes '[]' with name 'proposals' but there should be exactly 1. Looks like ObjectDetectionAPIProposalReplacement replacement didn't work.

Process finished with exit code 1
 

Could you please help me solve this problem? Thank you ! 

Shubha_R_Intel
Employee
255 Views

Dear King, Hesper

That error looks like you may not be on the latest and greatest OpenVino 2019R2.01. Have you upgraded ?

Please upgrade and try again. There is also a rfcn_support_api_v1.14.json in the 2.01 package which you haven't tried. It's kind of unfortunate to try every single one but the correct version number matches up with the Tensorflow API version which was used to freeze the modelThis document explains it but unfortunately, it's a bit out of date. There is a bug filed to update it.

Hope it helps,

Shubha

Reply