<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Tensorflow model exporter error - Cannot infer shapes or values for node &amp;quot;image_padding/Ceil_1&amp;quot; in Intel® Distribution of OpenVINO™ Toolkit</title>
    <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tensorflow-model-exporter-error-Cannot-infer-shapes-or-values/m-p/1168631#M15816</link>
    <description>&lt;P&gt;I am trying to export a frozen inference graph pb file.&amp;nbsp; It is a custom bbox detection network with inception v1 blocks.&amp;nbsp; While running the model optimizer, I am getting some errors.&amp;nbsp; The graph was trained and exported from tf v1.10.&amp;nbsp; I want to know how I&amp;nbsp; can debug this model and get it exported.&lt;/P&gt;&lt;P&gt;The command line I used&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;/opt/intel/openvino/deployment_tools/model_optimizer/mo_tf.py --input_model /data/work/face-rec/face-rec/src/assets/faceboxes-model.pb --input_shape "(1,1024,1024,3)" --input image_tensor  --output_dir ./ --log_level=DEBUG
&lt;/PRE&gt;

&lt;P&gt;The error that I am getting is as follows:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:128 ]  --------------------
[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:129 ]  Partial infer for image_padding/Ceil_1
[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:130 ]  Op: Ceil
[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:131 ]  Inputs:
[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:31 ]  input[0]: shape = [], value = 8.0
[ INFO ]  Called "tf_native_tf_node_infer" for node "image_padding/Ceil_1"
[ 2020-04-22 10:52:33,607 ] [ DEBUG ] [ tf:226 ]  Added placeholder with name 'image_padding/truediv_1_port_0_ie_placeholder'
[ 2020-04-22 10:52:33,607 ] [ DEBUG ] [ tf:239 ]  update_input_in_pbs: replace input 'image_padding/truediv_1' with input 'image_padding/truediv_1_port_0_ie_placeholder'
[ 2020-04-22 10:52:33,607 ] [ DEBUG ] [ tf:247 ]  Replacing input '0' of the node 'image_padding/Ceil_1' with placeholder 'image_padding/truediv_1_port_0_ie_placeholder'
[ ERROR ]  Cannot infer shapes or values for node "image_padding/Ceil_1".
[ ERROR ]  Input 0 of node image_padding/Ceil_1 was passed float from image_padding/truediv_1_port_0_ie_placeholder:0 incompatible with expected double.
[ ERROR ]  
[ ERROR ]  It can happen due to bug in custom shape infer function &amp;lt;function tf_native_tf_node_infer at 0x7f4cceef7378&amp;gt;.
[ ERROR ]  Or because the node inputs have incorrect values/shapes.
[ ERROR ]  Or because input shapes are incorrect (embedded to the model or passed via --input_shape).
[ 2020-04-22 10:52:33,759 ] [ DEBUG ] [ infer:196 ]  Node "image_padding/Ceil_1" attributes: {'pb': name: "image_padding/Ceil_1"
op: "Ceil"
input: "image_padding/truediv_1_port_0_ie_placeholder"
attr {
  key: "T"
  value {
    type: DT_DOUBLE
  }
}
, '_in_ports': {0: {'control_flow': False}}, '_out_ports': {0: {'control_flow': False}}, 'kind': 'op', 'name': 'image_padding/Ceil_1', 'op': 'Ceil', 'infer': &amp;lt;function tf_native_tf_node_infer at 0x7f4cceef7378&amp;gt;, 'is_output_reachable': True, 'is_undead': False, 'is_const_producer': False, 'is_partial_inferred': False}
[ ERROR ]  Exception occurred during running replacer "REPLACEMENT_ID" (&amp;lt;class 'extensions.middle.PartialInfer.PartialInfer'&amp;gt;): Stopped shape/value propagation at "image_padding/Ceil_1" node. 
 For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #38. 
[ 2020-04-22 10:52:33,761 ] [ DEBUG ] [ main:317 ]  Traceback (most recent call last):
  File "/home/azmath/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/importer.py", line 426, in import_graph_def
    graph._c_graph, serialized, options)  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input 0 of node image_padding/Ceil_1 was passed float from image_padding/truediv_1_port_0_ie_placeholder:0 incompatible with expected double.
&lt;/PRE&gt;

&lt;P&gt;I think I need to override the DT_DOUBLE to Float.&amp;nbsp; Could anyone guide me on how I can do that?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Apr 2020 05:58:02 GMT</pubDate>
    <dc:creator>Moosa__Azmath</dc:creator>
    <dc:date>2020-04-22T05:58:02Z</dc:date>
    <item>
      <title>Tensorflow model exporter error - Cannot infer shapes or values for node "image_padding/Ceil_1"</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tensorflow-model-exporter-error-Cannot-infer-shapes-or-values/m-p/1168631#M15816</link>
      <description>&lt;P&gt;I am trying to export a frozen inference graph pb file.&amp;nbsp; It is a custom bbox detection network with inception v1 blocks.&amp;nbsp; While running the model optimizer, I am getting some errors.&amp;nbsp; The graph was trained and exported from tf v1.10.&amp;nbsp; I want to know how I&amp;nbsp; can debug this model and get it exported.&lt;/P&gt;&lt;P&gt;The command line I used&lt;/P&gt;
&lt;PRE class="brush:bash; class-name:dark;"&gt;/opt/intel/openvino/deployment_tools/model_optimizer/mo_tf.py --input_model /data/work/face-rec/face-rec/src/assets/faceboxes-model.pb --input_shape "(1,1024,1024,3)" --input image_tensor  --output_dir ./ --log_level=DEBUG
&lt;/PRE&gt;

&lt;P&gt;The error that I am getting is as follows:&lt;/P&gt;

&lt;PRE class="brush:bash; class-name:dark;"&gt;[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:128 ]  --------------------
[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:129 ]  Partial infer for image_padding/Ceil_1
[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:130 ]  Op: Ceil
[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:131 ]  Inputs:
[ 2020-04-22 10:52:33,606 ] [ DEBUG ] [ infer:31 ]  input[0]: shape = [], value = 8.0
[ INFO ]  Called "tf_native_tf_node_infer" for node "image_padding/Ceil_1"
[ 2020-04-22 10:52:33,607 ] [ DEBUG ] [ tf:226 ]  Added placeholder with name 'image_padding/truediv_1_port_0_ie_placeholder'
[ 2020-04-22 10:52:33,607 ] [ DEBUG ] [ tf:239 ]  update_input_in_pbs: replace input 'image_padding/truediv_1' with input 'image_padding/truediv_1_port_0_ie_placeholder'
[ 2020-04-22 10:52:33,607 ] [ DEBUG ] [ tf:247 ]  Replacing input '0' of the node 'image_padding/Ceil_1' with placeholder 'image_padding/truediv_1_port_0_ie_placeholder'
[ ERROR ]  Cannot infer shapes or values for node "image_padding/Ceil_1".
[ ERROR ]  Input 0 of node image_padding/Ceil_1 was passed float from image_padding/truediv_1_port_0_ie_placeholder:0 incompatible with expected double.
[ ERROR ]  
[ ERROR ]  It can happen due to bug in custom shape infer function &amp;lt;function tf_native_tf_node_infer at 0x7f4cceef7378&amp;gt;.
[ ERROR ]  Or because the node inputs have incorrect values/shapes.
[ ERROR ]  Or because input shapes are incorrect (embedded to the model or passed via --input_shape).
[ 2020-04-22 10:52:33,759 ] [ DEBUG ] [ infer:196 ]  Node "image_padding/Ceil_1" attributes: {'pb': name: "image_padding/Ceil_1"
op: "Ceil"
input: "image_padding/truediv_1_port_0_ie_placeholder"
attr {
  key: "T"
  value {
    type: DT_DOUBLE
  }
}
, '_in_ports': {0: {'control_flow': False}}, '_out_ports': {0: {'control_flow': False}}, 'kind': 'op', 'name': 'image_padding/Ceil_1', 'op': 'Ceil', 'infer': &amp;lt;function tf_native_tf_node_infer at 0x7f4cceef7378&amp;gt;, 'is_output_reachable': True, 'is_undead': False, 'is_const_producer': False, 'is_partial_inferred': False}
[ ERROR ]  Exception occurred during running replacer "REPLACEMENT_ID" (&amp;lt;class 'extensions.middle.PartialInfer.PartialInfer'&amp;gt;): Stopped shape/value propagation at "image_padding/Ceil_1" node. 
 For more information please refer to Model Optimizer FAQ (https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_Model_Optimizer_FAQ.html), question #38. 
[ 2020-04-22 10:52:33,761 ] [ DEBUG ] [ main:317 ]  Traceback (most recent call last):
  File "/home/azmath/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/importer.py", line 426, in import_graph_def
    graph._c_graph, serialized, options)  # pylint: disable=protected-access
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input 0 of node image_padding/Ceil_1 was passed float from image_padding/truediv_1_port_0_ie_placeholder:0 incompatible with expected double.
&lt;/PRE&gt;

&lt;P&gt;I think I need to override the DT_DOUBLE to Float.&amp;nbsp; Could anyone guide me on how I can do that?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2020 05:58:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tensorflow-model-exporter-error-Cannot-infer-shapes-or-values/m-p/1168631#M15816</guid>
      <dc:creator>Moosa__Azmath</dc:creator>
      <dc:date>2020-04-22T05:58:02Z</dc:date>
    </item>
    <item>
      <title>Hi Azmath,</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tensorflow-model-exporter-error-Cannot-infer-shapes-or-values/m-p/1168632#M15817</link>
      <description>&lt;P&gt;Hi Azmath,&lt;/P&gt;&lt;P&gt;Can you please confirm if the model is one of the &lt;A href="https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_convert_model_Convert_Model_From_TensorFlow.html"&gt;supported topologies of tensorflow&lt;/A&gt;. For face detection problem kindly refer to &lt;A href="https://docs.openvinotoolkit.org/latest/_demos_python_demos_face_recognition_demo_README.html"&gt;Interactive face detection demo.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Surya&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2020 11:34:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tensorflow-model-exporter-error-Cannot-infer-shapes-or-values/m-p/1168632#M15817</guid>
      <dc:creator>SuryaPSC_Intel</dc:creator>
      <dc:date>2020-05-05T11:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tensorflow model exporter error - Cannot infer shapes or values for node "image_padding/Cei</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tensorflow-model-exporter-error-Cannot-infer-shapes-or-values/m-p/1189340#M19604</link>
      <description>&lt;P&gt;Is this issue solved? If yes, how did you solve this?&lt;/P&gt;
&lt;P&gt;I'm also facing a similar kind of issue.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jul 2020 14:08:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Tensorflow-model-exporter-error-Cannot-infer-shapes-or-values/m-p/1189340#M19604</guid>
      <dc:creator>ashna_12</dc:creator>
      <dc:date>2020-07-03T14:08:24Z</dc:date>
    </item>
  </channel>
</rss>

