Showing results for 
Search instead for 
Did you mean: 

Interla error during conversion of model

I'm trying to conver a model from tensorflow  with follow command:

python /opt/intel/openvino/deployment_tools/model_optimizer/ --saved_model_dir 'exportdirtracker' --input 'net/images[1 128 64 3]' --output_dir='exportdirtracker' --output=net/features --data_type FP16

but I have below bug error

I attach here the original checkpoint of model, and the saved version that I used for export. It's very important to found if there is a recovery for that or I shall dismiss Openvino from my application.

Log error:

Model Optimizer arguments:
Common parameters:
    - Path to the Input Model:     None
    - Path for generated IR:     /media/ulix/DATA/LINUX/smarthome/ACAM_Demo/exportdirtracker
    - IR output name:     saved_model
    - Log level:     ERROR
    - Batch:     Not specified, inherited from the model
    - Input layers:     net/images[1 128 64 3]
    - Output layers:     net/features
    - Input shapes:     Not specified, inherited from the model
    - Mean values:     Not specified
    - Scale values:     Not specified
    - Scale factor:     Not specified
    - Precision of IR:     FP16
    - Enable fusing:     True
    - Enable grouped convolutions fusing:     True
    - Move mean values to preprocess section:     False
    - Reverse input channels:     False
TensorFlow specific parameters:
    - Input model in text protobuf format:     False
    - Path to model dump for TensorBoard:     None
    - List of shared libraries with TensorFlow custom layers implementation:     None
    - Update the configuration file with input/output node names:     None
    - Use configuration file used to generate the model with Object Detection API:     None
    - Use the config file:     None
Model Optimizer version:     2020.2.0-60-g0bc66e26ff
[ 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 "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/utils/", line 288, in apply_transform
    for_graph_and_each_sub_graph_recursively(graph, replacer.find_and_replace_pattern)
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/middle/", line 58, in for_graph_and_each_sub_graph_recursively
  File "/opt/intel/openvino_2020.2.120/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 "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/middle/", line 95, in apply_pattern
    action(graph, match)
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/extensions/middle/", line 123, in replace_pattern
    cond_data = match['condition'].out_node(0)
  File "/opt/intel/openvino_2020.2.120/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 "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/", line 307, in main
    return driver(argv)
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/", line 272, in driver
    ret_res = emit_ir(prepare_ir(argv), argv)
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/", line 237, in prepare_ir
    graph = unified_pipeline(argv)
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/pipeline/", line 29, in unified_pipeline
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/utils/", line 334, in apply_replacements
    apply_replacements_list(graph, replacers_order)
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/utils/", line 324, in apply_replacements_list
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/utils/", line 124, in wrapper
    function(*args, **kwargs)
  File "/opt/intel/openvino_2020.2.120/deployment_tools/model_optimizer/mo/utils/", line 312, 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 ]  -------------------------------------------------

0 Kudos
2 Replies

Hi Enrico,

Please confirm that you are using supported topologies and supported framework layers for Tensorflow in your model. This issue might be due to an unsupported layer somewhere in your model.


Best Regards,



Yea, I found that the original model had some not supported layer and I fixed the them: not it works correctly. Just the error messages was a little ambigous.