Hi, guys,
I've been trying to get multiple outputs from dlc file, but alwary got "Aborted (core dumped)" error after setting setOutputLayers to any names.
I used inception_v3.dlc as an example which is generated from official sample (https://developer.qualcomm.com/sites/default/files/docs/snpe/tutorial_in...).
Here are my code snippet refer to another post (https://developer.qualcomm.com/forum/qdn-forums/software/qualcomm-neural...).
SDK : snpe-1.53.2.2811
OS : Ubuntu 20.02
=====================================================================
zdl::DlSystem::RuntimeList runtime_list;
zdl::DlSystem::Runtime_t runtime_cpu = zdl::DlSystem::Runtime_t::CPU;
std::unique_ptr<zdl::DlContainer::IDlContainer> container =
zdl::DlContainer::IDlContainer::open(zdl::DlSystem::String(dlc));
zdl::SNPE::SNPEBuilder snpeBuilder(container.get());
runtime_list.add(runtime_cpu);
// zdl::DlSystem::StringList outputList = {};
zdl::DlSystem::StringList outputList(0);
outputList.append("InceptionV3/Predictions/Reshape_1:0"); // output layer name
// If there are multiple output layers, pass that instead of empty array.
std::unique_ptr<zdl::SNPE::SNPE> model_handler = snpeBuilder.setOutputLayers(outputList).setRuntimeProcessorOrder(runtime_list).build();
std::unique_ptr<zdl::DlSystem::ITensor> input_tensor = zdl::SNPE::SNPEFactory::getTensorFactory().createTensor(model_handler->getInputDimensions());
zdl::DlSystem::ITensor *tensor_ptr = input_tensor.get();
=====================================================================
I got output layer name by typing "snpe-dlc-info -i ./inception_v3.dlc".
And I got the following results from the last couple of outputs, I used InceptionV3/Predictions/Reshape_1:0 as my outupt name.
=====================================================================
...
| 215 | InceptionV3/Logits/SpatialSqueeze:0 | reshape | InceptionV3/Logits/Conv2d_1c_1x1/BiasAdd:0 | InceptionV3/Predictions/Reshape:0 | 1x1001 | A D G C | |
| 216 | InceptionV3/Predictions/Softmax | softmax | InceptionV3/Predictions/Reshape:0 | InceptionV3/Predictions/Reshape_1:0 | 1x1001 | A D G C | |
=====================================================================
It seems the only way to make it work is to set snpeBuilder.setOutputLayers({}), but this surely won't work in multiple output situation.
I've wonderd what I've done wrong since I've tried approaches from some posts on the forum
Thanks!
Dear customer,
SNPE supported to multiple output if you specific with the following guide at your input.txt.
#outptut_node1<empty space> output_node2
input.raw
BR.
Wei
Hi simon_lin,
I met the save problem .
Have you found the right way to get multi output names from dlc?
Thank you.
Hi, simon_lin
Maybe you can use " InceptionV3/Predictions/Softmax" instead of "InceptionV3/Predictions/Reshape_1:0". Don't use out_node to construct outputList
hi,all, I met the same issue and found a way.
when you use userbuffer, you need to call setOutputLayers, you should pass the layer names instead of node name. let' see
=====================================================================
...
| 215 | InceptionV3/Logits/SpatialSqueeze:0 | reshape | InceptionV3/Logits/Conv2d_1c_1x1/BiasAdd:0 | InceptionV3/Predictions/Reshape:0 | 1x1001 | A D G C | |
| 216 | InceptionV3/Predictions/Softmax | softmax | InceptionV3/Predictions/Reshape:0 | InceptionV3/Predictions/Reshape_1:0 | 1x1001 | A D G C | |
=====================================================================
the last two layers name are InceptionV3/Logits/SpatialSqueeze:0 and InceptionV3/Predictions/Softmax, which are behind of layer numbers.