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?
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();