Forums - Converting Squeezenet fails ERROR_TF_LAYER_INPUT_COUNT_ERROR

2 posts / 0 new
Last post
Converting Squeezenet fails ERROR_TF_LAYER_INPUT_COUNT_ERROR
t.wittekind2
Join Date: 28 Nov 17
Posts: 3
Posted: Mon, 2017-12-04 06:32

Hello,

I try to convert a Tensorflow Squeezenet model (protobuf.pb) to a dlc. 

The Squeezenet model is defined using python:

//some other layers
net = slim.conv2d(net, 1000, [1, 1], activation_fn=None, normalizer_fn=None, scope='conv10')
net = slim.avg_pool2d(net, net.get_shape()[1:3], scope='avgpool10')
net = tf.squeeze(net, [1, 2], name='logits')
net = slim.fully_connected(net, bottleneck_layer_size, activation_fn=None,  scope='Bottleneck', reuse=False) 
 
My command:
 

./snpe-tensorflow-to-dlc --graph 'protobuf.pb' --input_dim 'input' 160,160,3  --out_node embeddings --allow_unconsumed_nodes

fails:

tensorflow/layers/reshape.py:78: RuntimeWarning: error_code=1004; error_message=Layer parameters combination is invalid. Layer squeezenet/Bottleneck/BatchNorm/Reshape:0: tensor size mismatch between input {1, 1, 1000} and output {1, 1, 128}; error_component=Model Validation; line_no=138; thread_id=140398003033920
  descriptor.output_names[0])
2017-12-04 10:58:52,241 - 123 - ERROR - Conversion failed: ERROR_TF_LAYER_INPUT_COUNT_ERROR: Layer AvgPooling expects 1 input(s), actual 2
 
When I load the same protobuf.pb in python using Tensorflow ther is no problem. How can i fix the poblem and convert the model?
  • Up0
  • Down0
dmarques
Join Date: 15 Sep 17
Posts: 27
Posted: Thu, 2017-12-07 13:07

Please provide a complete minimal example which illustrates the issue as text or pb file (preferable).

  • 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.