Forums - You must feed a value for placeholder tensor 'image_tensor' with dtype uint8 and shape [?,?,?,3]

4 posts / 0 new
Last post
You must feed a value for placeholder tensor 'image_tensor' with dtype uint8 and shape [?,?,?,3]
32437506
Join Date: 5 Dec 17
Posts: 6
Posted: Thu, 2017-12-07 01:45

When I was tring to convert ssd moblienet pb  to dlc ,I have came across such a error :

 

 

2017-12-07 17:37:06,766 - 298 - INFO - INFO_TF_CONVERTING_SCOPES: Converting scope (FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/): [u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/mul_1', u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/add_1']
2017-12-07 17:37:06,797 - 301 - INFO - INFO_TF_CONVERTING_SCOPES: Converting scope (FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/): [u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/mul_1', u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/add_1']
2017-12-07 17:37:06,797 - 298 - INFO - INFO_TF_CONVERTING_SCOPES: Converting scope (FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/): []
2017-12-07 17:37:06,798 - 301 - INFO - INFO_TF_CONVERTING_SCOPES: Converting scope (FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/): [u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/mul_1', u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/add_1']
2017-12-07 17:37:06,798 - 298 - INFO - INFO_TF_CONVERTING_SCOPES: Converting scope (FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/): [u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/Relu6']
2017-12-07 17:37:06,799 - 301 - INFO - INFO_TF_CONVERTING_SCOPES: Converting scope (FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/): [u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/mul_1', u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/BatchNorm/batchnorm/add_1', u'FeatureExtractor/MobilenetV1/Conv2d_13_pointwise_2_Conv2d_5_3x3_s2_128/Relu6']
2017-12-07 17:37:06,800 - 298 - INFO - INFO_TF_CONVERTING_SCOPES: Converting scope (FeatureExtractor/MobilenetV1/): [u'FeatureExtractor/MobilenetV1/Shape_2', u'FeatureExtractor/MobilenetV1/strided_slice_2', u'FeatureExtractor/MobilenetV1/zeros', u'FeatureExtractor/MobilenetV1/concat', u'FeatureExtractor/MobilenetV1/zeros_1', u'FeatureExtractor/MobilenetV1/concat_1', u'FeatureExtractor/MobilenetV1/Shape_3', u'FeatureExtractor/MobilenetV1/strided_slice_3', u'FeatureExtractor/MobilenetV1/zeros_2', u'FeatureExtractor/MobilenetV1/concat_2', u'FeatureExtractor/MobilenetV1/zeros_3', u'FeatureExtractor/MobilenetV1/concat_3']
2017-12-07 17:37:06,834 - 126 - ERROR - Encountered Error: You must feed a value for placeholder tensor 'image_tensor' with dtype uint8 and shape [?,?,?,3]
     [[Node: image_tensor = Placeholder[dtype=DT_UINT8, shape=[?,?,?,3], _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

Caused by op u'image_tensor', defined at:
  File "/home/app/snpe/snpe-1.8.0/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc", line 131, in <module>
    main()
  File "/home/app/snpe/snpe-1.8.0/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc", line 116, in main
    model = loader.load(args.graph, in_nodes, in_dims, args.in_type, args.out_node, session)
  File "/home/app/snpe/snpe-1.8.0/lib/python/converters/tensorflow/loader.py", line 67, in load
    graph_def = self.__import_graph(graph_pb_or_meta_path, session, out_node_names)
  File "/home/app/snpe/snpe-1.8.0/lib/python/converters/tensorflow/loader.py", line 128, in __import_graph
    tf.import_graph_def(graph_def, name="")
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/framework/importer.py", line 313, in import_graph_def
    op_def=op_def)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
    op_def=op_def)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'image_tensor' with dtype uint8 and shape [?,?,?,3]
     [[Node: image_tensor = Placeholder[dtype=DT_UINT8, shape=[?,?,?,3], _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

Traceback (most recent call last):
  File "/home/app/snpe/snpe-1.8.0/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc", line 120, in main
    converter.convert(args.dlc, args.model_version, converter_command)
  File "/home/app/snpe/snpe-1.8.0/lib/python/converters/tensorflow/converter.py", line 262, in convert
    self._convert_layers()
  File "/home/app/snpe/snpe-1.8.0/lib/python/converters/tensorflow/converter.py", line 299, in _convert_layers
    descriptors.extend(self._resolve_descriptors_from_scope(scope.name, scope.child_ops()))
  File "/home/app/snpe/snpe-1.8.0/lib/python/converters/tensorflow/converter.py", line 368, in _resolve_descriptors_from_scope
    candidate_descriptor = resolver.resolve_layer(scope_name, remaining_ops, self._graph_helper)
  File "/home/app/snpe/snpe-1.8.0/lib/python/converters/tensorflow/layers/concat.py", line 54, in resolve_layer
    axis = int(axis_tensor.outputs[0].eval()) - 1
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 570, in eval
    return _eval_using_default_session(self, feed_dict, self.graph, session)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 4455, in _eval_using_default_session
    return session.run(tensors, feed_dict)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 889, in run
    run_metadata_ptr)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1120, in _run
    feed_dict_tensor, options, run_metadata)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run
    options, run_metadata)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call
    raise type(e)(node_def, op, message)
InvalidArgumentError: You must feed a value for placeholder tensor 'image_tensor' with dtype uint8 and shape [?,?,?,3]
     [[Node: image_tensor = Placeholder[dtype=DT_UINT8, shape=[?,?,?,3], _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

Caused by op u'image_tensor', defined at:
  File "/home/app/snpe/snpe-1.8.0/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc", line 131, in <module>
    main()
  File "/home/app/snpe/snpe-1.8.0/bin/x86_64-linux-clang/snpe-tensorflow-to-dlc", line 116, in main
    model = loader.load(args.graph, in_nodes, in_dims, args.in_type, args.out_node, session)
  File "/home/app/snpe/snpe-1.8.0/lib/python/converters/tensorflow/loader.py", line 67, in load
    graph_def = self.__import_graph(graph_pb_or_meta_path, session, out_node_names)
  File "/home/app/snpe/snpe-1.8.0/lib/python/converters/tensorflow/loader.py", line 128, in __import_graph
    tf.import_graph_def(graph_def, name="")
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/framework/importer.py", line 313, in import_graph_def
    op_def=op_def)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
    op_def=op_def)
  File "/home/app/.local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 1470, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'image_tensor' with dtype uint8 and shape [?,?,?,3]
     [[Node: image_tensor = Placeholder[dtype=DT_UINT8, shape=[?,?,?,3], _device="/job:localhost/replica:0/task:0/device:CPU:0"]()]]

INFO: Creating ssd_mobilenet_v1_android_export_quantized.dlc quantized model
INFO: Setup inception_v3 completed.
 

was it a issue that need a new SDK version release to handle ? thanks!

  • Up0
  • Down0
sam
Join Date: 11 Jan 18
Posts: 8
Posted: Fri, 2018-01-12 01:46

Hi, even i'm facing the same issue, did you resolved it ?

  • Up0
  • Down0
sam
Join Date: 11 Jan 18
Posts: 8
Posted: Fri, 2018-01-12 03:50

Try this, i think it might solve your problem:

snpe-tensorflow-to-dlc --graph tensorflow/ssd_mobilenet_v1.pb --input_dim "image_tensor" 512,512,3 --out_node some_node --dlc dlc/ --allow_unconsumed_nodes

  • Up0
  • Down0
harshiddh.mania
Join Date: 4 Jan 18
Posts: 4
Posted: Thu, 2018-02-15 14:31

Try below command, It should work.

The inpout node `image_tensor`, accepts a uint8 4-D tensor of shape.

snpe-tensorflow-to-dlc --graph /tensorflow/ssd_mobilenet_v1.pb --input_dim image_tensor 512,512,512,3 --dlc ssd_mobilenet_v1.dlc --out_node detection_boxes --out_node detection_scores --out_node detection_classes --out_node num_detections --allow_unconsumed_nodes

 

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.