Community
cancel
Showing results for 
Search instead for 
Did you mean: 
bai__val
Beginner
115 Views

Unexpected exception happened. Please contact Model Optimizer developers and forward the following information

Hello!

I'm working in Ubuntu  and using Python API

I'm trying to run my YOLO3 Mobilenet model in Neural Compute Stick. 

When I run: sudo python3 mo.py --input_model /home/Desktop/keras_to_tensorflow-master/logs/tf_model.pb --input_shape [1,416,416,3],[1,13,13,3,10],[1,26,26,3,10],[1,52,52,3,10] --input input_1,input_2,input_3,input_4 --output yolo_loss/Select, I get this error 

[ 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.front.input_cut.InputCut'>)": Attempt to access node input_3 that not in graph
[ ERROR ]  Traceback (most recent call last):
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/utils/class_registration.py", line 271, in apply_replacements
    replacer.find_and_replace_pattern(graph)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/extensions/front/input_cut.py", line 34, in find_and_replace_pattern
    add_input_ops(graph, graph.graph['user_shapes'], True)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/front/extractor.py", line 1118, in add_input_ops
    smart_node = Node(graph, node_id)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/graph/graph.py", line 35, in __init__
    assert node in graph, "Attempt to access node {} that not in graph".format(node)
AssertionError: Attempt to access node input_3 that not in graph

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

Traceback (most recent call last):
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/main.py", line 302, in main
    return driver(argv)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/main.py", line 251, in driver
    is_binary=not argv.input_model_is_text)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/pipeline/tf.py", line 133, in tf2nx
    class_registration.apply_replacements(graph, class_registration.ClassType.FRONT_REPLACER)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/utils/class_registration.py", line 299, in apply_replacements
    )) from err
Exception: Exception occurred during running replacer "REPLACEMENT_ID (<class 'extensions.front.input_cut.InputCut'>)": Attempt to access node input_3 that not in graph

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

0 Kudos
3 Replies
Sahira_Intel
Moderator
115 Views

Hi Val,

I see this is a converted model from Keras to Tensorflow - did you convert yourself? Can you please attach your model so I can take a look at it?

Best Regards,

Sahira 

bai__val
Beginner
115 Views

Hello, Sahira.

Thank you for your comment. It is a private model , would you please PM me and I can privately send you the model.

I  converted model from Keras to Tensorflow using keras_to_tensorflow.py https://github.com/amir-abdi/keras_to_tensorflow

When I run:

sudo python3 mo_tf.py --input_model /home/Desktop/keras_to_tensorflow-master/logs/tf_model.pb  --input_shape [1,416,416,3] --input input_1 --output conv2d_7/BiasAdd,conv2d_15/BiasAdd,conv2d_23/BiasAdd 

i get this error:

[ ERROR ]  List of operations that cannot be converted to Inference Engine IR:
[ ERROR ]      AddV2 (47)
[ ERROR ]          conv1_bn/batchnorm/add_1
[ ERROR ]          conv_dw_1_bn/batchnorm/add_1
[ ERROR ]          conv_pw_1_bn/batchnorm/add_1
[ ERROR ]          conv_dw_2_bn/batchnorm/add_1
[ ERROR ]          conv_pw_2_bn/batchnorm/add_1
[ ERROR ]          conv_dw_3_bn/batchnorm/add_1
[ ERROR ]          conv_pw_3_bn/batchnorm/add_1
[ ERROR ]          conv_dw_4_bn/batchnorm/add_1
[ ERROR ]          conv_pw_4_bn/batchnorm/add_1
[ ERROR ]          conv_dw_5_bn/batchnorm/add_1
[ ERROR ]          conv_pw_5_bn/batchnorm/add_1
[ ERROR ]          conv_dw_6_bn/batchnorm/add_1
[ ERROR ]          conv_pw_6_bn/batchnorm/add_1
[ ERROR ]          conv_dw_7_bn/batchnorm/add_1
[ ERROR ]          conv_pw_7_bn/batchnorm/add_1
[ ERROR ]          conv_dw_8_bn/batchnorm/add_1
[ ERROR ]          conv_pw_8_bn/batchnorm/add_1
[ ERROR ]          conv_dw_9_bn/batchnorm/add_1
[ ERROR ]          conv_pw_9_bn/batchnorm/add_1
[ ERROR ]          conv_dw_10_bn/batchnorm/add_1
[ ERROR ]          conv_pw_10_bn/batchnorm/add_1
[ ERROR ]          conv_dw_11_bn/batchnorm/add_1
[ ERROR ]          conv_pw_11_bn/batchnorm/add_1
[ ERROR ]          conv_dw_12_bn/batchnorm/add_1
[ ERROR ]          conv_pw_12_bn/batchnorm/add_1
[ ERROR ]          conv_dw_13_bn/batchnorm/add_1
[ ERROR ]          conv_pw_13_bn/batchnorm/add_1
[ ERROR ]          batch_normalization_1/batchnorm/add_1
[ ERROR ]          batch_normalization_2/batchnorm/add_1
[ ERROR ]          batch_normalization_3/batchnorm/add_1
[ ERROR ]          batch_normalization_4/batchnorm/add_1
[ ERROR ]          batch_normalization_5/batchnorm/add_1
[ ERROR ]          batch_normalization_7/batchnorm/add_1
[ ERROR ]          batch_normalization_8/batchnorm/add_1
[ ERROR ]          batch_normalization_9/batchnorm/add_1
[ ERROR ]          batch_normalization_10/batchnorm/add_1
[ ERROR ]          batch_normalization_11/batchnorm/add_1
[ ERROR ]          batch_normalization_12/batchnorm/add_1
[ ERROR ]          batch_normalization_13/batchnorm/add_1
[ ERROR ]          batch_normalization_14/batchnorm/add_1
[ ERROR ]          batch_normalization_15/batchnorm/add_1
[ ERROR ]          batch_normalization_16/batchnorm/add_1
[ ERROR ]          batch_normalization_17/batchnorm/add_1
[ ERROR ]          batch_normalization_18/batchnorm/add_1
[ ERROR ]          batch_normalization_19/batchnorm/add_1
[ ERROR ]          batch_normalization_20/batchnorm/add_1
[ ERROR ]          batch_normalization_6/batchnorm/add_1
 

then I tried to run:

sudo python3 mo_tf.py --input_model /home/Desktop/keras_to_tensorflow-master/logs/tf_model.pb  --input_shape [1,416,416,3] --input input_1 --output conv2d_7/BiasAdd,conv2d_15/BiasAdd,conv2d_23/BiasAdd --tensorflow_operation_patterns  AddV2

I get this error


[ 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.CustomSubgraphCall.CustomSubgraphCall'>)": Attempt to connect conv1_bn/moving_variance/read/Output_0/Data_ to Reshape_. Node Reshape_ has no in port (0)
[ ERROR ]  Traceback (most recent call last):
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/utils/class_registration.py", line 273, in apply_replacements
    for_graph_and_each_sub_graph_recursively(graph, replacer.find_and_replace_pattern)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/middle/pattern_match.py", line 58, in for_graph_and_each_sub_graph_recursively
    func(graph)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/extensions/middle/CustomSubgraphCall.py", line 322, in find_and_replace_pattern
    CustomSubgraphCall.add_reshapes_for_tf_subgraph_calls(graph)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/extensions/middle/CustomSubgraphCall.py", line 262, in add_reshapes_for_tf_subgraph_calls
    CustomSubgraphCall.add_reshape_before_op_node(graph, src_node_name, dst_node_name, edge_attrs)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/extensions/middle/CustomSubgraphCall.py", line 182, in add_reshape_before_op_node
    (reshaped_data_node_name, op_node_name, edge_attrs)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/graph/graph.py", line 546, in add_edges_from
    self.add_edge(u, v, key=key, **ddd)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/graph/graph.py", line 523, in add_edge
    assert vnode.has_port('in', attr['in']), "{} Node {} has no in port ({})".format(message, vnode.name, attr['in'])
AssertionError: Attempt to connect conv1_bn/moving_variance/read/Output_0/Data_ to Reshape_. Node Reshape_ has no in port (0)

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

Traceback (most recent call last):
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/main.py", line 302, in main
    return driver(argv)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/main.py", line 251, in driver
    is_binary=not argv.input_model_is_text)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/pipeline/tf.py", line 134, in tf2nx
    class_registration.apply_replacements(graph, class_registration.ClassType.MIDDLE_REPLACER)
  File "/opt/intel/openvino_2019.2.275/deployment_tools/model_optimizer/mo/utils/class_registration.py", line 299, in apply_replacements
    )) from err
Exception: Exception occurred during running replacer "REPLACEMENT_ID (<class 'extensions.middle.CustomSubgraphCall.CustomSubgraphCall'>)": Attempt to connect conv1_bn/moving_variance/read/Output_0/Data_ to Reshape_. Node Reshape_ has no in port (0)

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

 

 

Sahira_Intel
Moderator
115 Views

Hi Val,

I have sent you a PM. Please respond there.

Best Regards,

Sahira 

Reply