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.

Unresolved Exception


I am trying to convert a tensorflow frozen graph (.pb format) into the Intermediate Representation format as required. I am using the model optimizer. I end up getting the following exception for which I can't find a solution  anywhere: 

[ ERROR ]  -------------------------------------------------
[ ERROR ]  ----------------- INTERNAL ERROR ----------------
[ ERROR ]  Unexpected exception happened.
[ ERROR ]  Please contact Model Optimizer developers and forward the following information:
[ ERROR ]  Exception occurred during running replacer "REPLACEMENT_ID (<class 'extensions.middle.TensorIteratorMerge.TensorIteratorMerge'>)": 0
[ ERROR ]  Traceback (most recent call last):
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/utils/", line 287, in apply_transform
    for_graph_and_each_sub_graph_recursively(graph, replacer.find_and_replace_pattern)
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/middle/", line 58, in for_graph_and_each_sub_graph_recursively
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/utils/", line 29, in find_and_replace_pattern
    apply_pattern(graph, **self.pattern(), action=self.replace_pattern)  # pylint: disable=no-member
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/middle/", line 95, in apply_pattern
    action(graph, match)
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/extensions/middle/", line 123, in replace_pattern
    cond_data = match['condition'].out_node(0)
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/graph/", line 235, in out_node
    return self.out_nodes(control_flow=control_flow)[key]
KeyError: 0

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/", line 314, in main
    return driver(argv)
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/", line 281, in driver
    ret_res = emit_ir(prepare_ir(argv), argv)
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/", line 226, in prepare_ir
    graph = mo_tf.driver(argv)
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/pipeline/", line 111, in driver
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/utils/", line 324, in apply_replacements
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/utils/", line 124, in wrapper
    function(*args, **kwargs)
  File "/home/tejasrsimha/intel/openvino_2020.1.023/deployment_tools/model_optimizer/mo/utils/", line 309, in apply_transform
    )) from err
Exception: Exception occurred during running replacer "REPLACEMENT_ID (<class 'extensions.middle.TensorIteratorMerge.TensorIteratorMerge'>)": 0

[ ERROR ]  ---------------- END OF BUG REPORT --------------
[ ERROR ]  -------------------------------------------------

Please help. 

0 Kudos
2 Replies

Can you confirm that you are using the tensorflow supported topologies and supported layers.

Are you using Public or custom model?

What is the model optimizer command that you have used?

We recommend to use the latest OpenVINO(2020.2) version


Ram prasad

0 Kudos

Hello Ram Prasad. Thank you for the reply. 
I will check the layers being used. 
I am using the 2020.1 version.
The command that I used is as follows: python3 --input_model PATH_TO_MODEL

I have even tried to use the model optimizer script that is specific to tensorflow models: python3 --input_model PATH_TO_MODEL. 
I will get back to you regarding the layers used. 
As this is a publicly available model, I didn't check to see if any custom layers have been used. 

0 Kudos