Forums - Multiple output tensors

2 posts / 0 new
Last post
Multiple output tensors
isharaka.gunasinghe
Join Date: 14 Dec 21
Posts: 1
Posted: Wed, 2021-12-15 03:34

Hello,

I am trying to load a network with multiple output tensors. I am folloing the example from https://developer.qualcomm.com/comment/17482#comment-17482

        zdl::DlSystem::StringList output_names;
        output_names.append("xxxx");

        output_names.append("yyyy");

        _snpe = snpe_builder.setOutputLayers(output_names).setRuntimeProcessorOrder(input_runtime_list).build();

I am unsure as to what to provide for the output layer names. Could you advise on this please?
 
When I try with an empty output_names list, only one output is emitted. The name of this is "dense_multiple_output_model/dense/MatMul:0" is as reported by getTensorNames().
 
        zdl::DlSystem::TensorMap output_tensor_map;
        _snpe->execute(_features.get(), output_tensor_map);
        zdl::DlSystem::StringList tensor_names = output_tensor_map.getTensorNames();
 
I have tried various substrings of "dense_multiple_output_model/dense/MatMul:0" as xxxx . SO far snpe builder returns null.
 
These are information on the tensorflow model I used to create the DLC file.
 
FROZEN TENSORFLOW MODEL LAYERS: 
inputs
dense_multiple_output_model/flatten/Const
dense_multiple_output_model/flatten/Reshape
dense_multiple_output_model/dense/MatMul/ReadVariableOp/resource
dense_multiple_output_model/dense/MatMul/ReadVariableOp
dense_multiple_output_model/dense/MatMul
dense_multiple_output_model/dense_1/MatMul/ReadVariableOp/resource
dense_multiple_output_model/dense_1/MatMul/ReadVariableOp
Identity
dense_multiple_output_model/flatten_1/Const
dense_multiple_output_model/flatten_1/Reshape
dense_multiple_output_model/dense_1/MatMul
Identity_1
 
FROZEN TENSORFLOW MODEL INPUTS: 
[<tf.Tensor 'inputs:0' shape=(1, 3, 3, 1) dtype=float32>]
 
FROZEN TENSORFLOW MODEL OUTPUTS: 
[<tf.Tensor 'Identity:0' shape=(1, 3) dtype=float32>, <tf.Tensor 'Identity_1:0' shape=(1, 1) dtype=float32>]
 
 

 

 

  • Up0
  • Down0
1020258195
Join Date: 8 Jul 21
Posts: 8
Posted: Wed, 2021-12-22 17:56

Hi

    I think you can use snpe-dlc-info to show the net and use the list of Name for output.

    This is my code.

'''

    zdl::DlSystem::StringList outputLayerNames = {};

    outputLayerNames.append("Conv_260");

    _engine = snpe_builder
            .setOutputLayers(outputLayerNames)
'''
  • 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.