Forums - Can't get all output tensor name in output tensor map

2 posts / 0 new
Last post
Can't get all output tensor name in output tensor map
yuris
Join Date: 23 May 23
Posts: 2
Posted: Mon, 2023-12-04 02:08

This is my code:
status = snpe_->execute(input_tensor.get(), output_tensor_map_);
zdl::DlSystem::StringList tensor_names = output_tensor_map_.getTensorNames();
if(out.size() != tensor_names.size()){
std::cerr << "ERROR: Number of outputs does not match network.\n"
<< "Expecting: " << tensor_names.size() << "\n"
<< "Got: " << out.size() << "\n"
But I got this result:

ERROR: Number of outputs does not match network.
Expecting: 1
Got: 4
I have used snpe-dlc-info to check the numbers of my model's outputs. It displayed 4 output names:

out_names=['999', '1002', '1005', '1008']
Why I can't get all output tensor names in output tensor map?

  • Up0
  • Down0
yuris
Join Date: 23 May 23
Posts: 2
Posted: Wed, 2023-12-13 02:01

I have soled this problem.
Instead of ITensor, I used UserBuffer to take the inputs and the outputs and successfully got all the output tensor by getUserBufferNames:
const zdl::DlSystem::StringList& inputBufferNames = inputMap.getUserBufferNames();

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