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?
Hi,
I think you can use the command snpe-dlc-info -i <dlc_file> it will show the list of output names.
HI sanjjey.a.sanjjey
Thanks for your reply.
I am working on aarch64, but [snpe-dlc-info] only supported on x86_64.
hi
You could try to set in the builder creation option
setDebugEnabled(true).
and than you should get all output tensor names.
best regards
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:
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
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.
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::StringList > getOutputLayerNames () const noexcept
so could you please try
location: this https://developer.qualcomm.com/sites/default/files/docs/snpe/group__c__p...
Best regards,
Hello, I met the same error
my model has two outputs, but only get single using "getOutputTensorNames"
Any solutions ? Thanks so mush !
I am working on aarch64, but [snpe-dlc-info] only supported on x86_64.
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
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.