Forums - How can i get ouput tensor names after the container loaded?

12 posts / 0 new
Last post
How can i get ouput tensor names after the container loaded?
wuyefeima
Join Date: 21 Feb 22
Posts: 5
Posted: Mon, 2022-08-08 02:18

zdl::SNPE::SNPEBuilder snpeBuilder(container.get());

snpe = snpeBuilder.setOutputTensors({}) .setRuntimeProcessorOrder(runtimeList) .setUseUserSuppliedBuffers(useUserSuppliedBuffers) .setPlatformConfig(platformConfig) .setInitCacheMode(useCaching) .build();

After define snpe object, I can get output tensor names like this:

snpe.getOutputTensorNames()

But when the output has multi tensors, I can only get one tensor name.

 

How can I get multi output tensor names?

  • Up0
  • Down0
sanjjey.a.sanjjey
Join Date: 17 May 22
Posts: 55
Posted: Tue, 2022-08-09 01:46

Hi,

I think you can use the command snpe-dlc-info -i <dlc_file> it will show the list of output names.

  • Up0
  • Down0
wuyefeima
Join Date: 21 Feb 22
Posts: 5
Posted: Tue, 2022-08-09 02:04

HI sanjjey.a.sanjjey

Thanks for your reply.

I am  working on aarch64,  but [snpe-dlc-info] only supported on x86_64.

  • Up0
  • Down0
nikola.nenadic
Join Date: 27 Feb 18
Posts: 5
Posted: Thu, 2022-08-25 12:49

hi

You could try to set in the builder creation option

setDebugEnabled(true).

and than you should get all output tensor names.

best regards

  • Up0
  • Down0
wuyefeima
Join Date: 21 Feb 22
Posts: 5
Posted: Sun, 2022-08-28 18:24

This will display all outputs.  How can I judge which are the final outputs?

For example,  The final outputs  of my network is [114, 116, 118].  

But after setDebugMode(true), I got the following output names:

 [SetBuilderOptons] name = 100
 [SetBuilderOptons] name = 101
 [SetBuilderOptons] name = 102
 [SetBuilderOptons] name = 103
 [SetBuilderOptons] name = 104
 [SetBuilderOptons] name = 105
 [SetBuilderOptons] name = 106
 [SetBuilderOptons] name = 107
 [SetBuilderOptons] name = 108
 [SetBuilderOptons] name = 109
 [SetBuilderOptons] name = 110
 [SetBuilderOptons] name = 111
 [SetBuilderOptons] name = 112
 [SetBuilderOptons] name = 113
 [SetBuilderOptons] name = 114
 [SetBuilderOptons] name = 115
 [SetBuilderOptons] name = 116
 [SetBuilderOptons] name = 117
 [SetBuilderOptons] name = 118
 [SetBuilderOptons] name = 49
 [SetBuilderOptons] name = 50
 [SetBuilderOptons] name = 51
 [SetBuilderOptons] name = 52
 [SetBuilderOptons] name = 53
 [SetBuilderOptons] name = 54
 [SetBuilderOptons] name = 55
 [SetBuilderOptons] name = 56
 [SetBuilderOptons] name = 57
 [SetBuilderOptons] name = 58
 [SetBuilderOptons] name = 59
 [SetBuilderOptons] name = 60
 [SetBuilderOptons] name = 61
 [SetBuilderOptons] name = 62
 [SetBuilderOptons] name = 63
 [SetBuilderOptons] name = 64
 [SetBuilderOptons] name = 65
 [SetBuilderOptons] name = 66
 [SetBuilderOptons] name = 67
 [SetBuilderOptons] name = 68
 [SetBuilderOptons] name = 69
 [SetBuilderOptons] name = 70
 [SetBuilderOptons] name = 71
 [SetBuilderOptons] name = 72
 [SetBuilderOptons] name = 73
 [SetBuilderOptons] name = 74
 [SetBuilderOptons] name = 84
 [SetBuilderOptons] name = 85
 [SetBuilderOptons] name = 86
 [SetBuilderOptons] name = 87
 [SetBuilderOptons] name = 88
 [SetBuilderOptons] name = 89
 [SetBuilderOptons] name = 99

 

 

  • Up0
  • Down0
nikola.nenadic
Join Date: 27 Feb 18
Posts: 5
Posted: Tue, 2022-08-30 12:47

Hi

You can use online tool to check the network structure https://netron.app/

or you could use snpe-dlc-info -i network.dlc  | grep "114x116x118"

and the one that is in the output layer and not in any input that is the one.

Best regards

  • Up0
  • Down0
wuyefeima
Join Date: 21 Feb 22
Posts: 5
Posted: Mon, 2022-09-19 01:37

Thank you for your reply.

However, i  do not mean there's  no  tool  to get final output names. 

The key point is:   I want to catch a simple way to get final output names   in  C++.  Because my program is entended to run in arm64.

  • Up0
  • Down0
nikola.nenadic
Join Date: 27 Feb 18
Posts: 5
Posted: Mon, 2022-09-19 14:33

hi,

Sorry for misunderstanding

Since i use JAVA i am not 100% sure in C++ but analogy should work

network.getOutputTensorsNames()

This functin provide set of the output names.

In the C++ as i find in the API descriptioin you can use

zdl::DlSystem::Optional< zdl::DlSystem::StringListgetOutputLayerNames () const noexcept

so could you please try

location: this https://developer.qualcomm.com/sites/default/files/docs/snpe/group__c__p...

 

Best regards,

 

  • Up0
  • Down0
liwei.fang
Join Date: 8 Mar 22
Posts: 7
Posted: Mon, 2022-10-17 03:27

Hello, I met the same error

my model has two outputs, but only get single using "getOutputTensorNames"

Any solutions ? Thanks so mush !

  • Up0
  • Down0
bhuvahh
Join Date: 21 Nov 22
Posts: 1
Posted: Mon, 2022-11-21 05:29

I am  working on aarch64,  but [snpe-dlc-info] only supported on x86_64.

  •  

 

  • Up0
  • Down0
ss.pandiri
Join Date: 29 May 18
Posts: 58
Posted: Mon, 2022-11-28 22:22

hello,

The function getOutputTensorNames() returns  'zdl::DlSystem::StringList' object. Please use the 'size' member function and retrieve the full list of output tensors through 'at' member function. Please see the doucmentation here:

https://developer.qualcomm.com/sites/default/files/docs/snpe/group__c__p...

thanks

  • Up0
  • Down0
dchrzanowski
Join Date: 9 Nov 23
Posts: 1
Posted: Thu, 2023-11-09 05:32

As per documentation, if one doesn't use `Snpe_SNPEBuilder_SetOutputTensors` or sets an empty list of tensors' names, the SNPE inference will return the last (one) tensor.

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