Forums - Why ssd-mobilenet has only one output node?

1 post / 0 new
Why ssd-mobilenet has only one output node?
thinksmert
Join Date: 7 Nov 19
Posts: 1
Posted: Thu, 2019-11-21 22:03

Hi,everyone

   I invoke ssd-mobilenet model in my own android project,the model has been convert to dlc by the following script:

snpe-tensorflow-to-dlc \
 --input_network /tensorflow/backup/frozen_inference_graph.pb \
 --input_dim Preprocessor/sub 1,300,300,3 \
 --out_node detection_classes \
 --out_node detection_boxes \
 --out_node detection_scores \
 --output_path /tensorflow/mobilenet_ssd.dlc \
 --allow_unconsumed_nodes
 
and I load the model by these codes:
SNPE.NeuralNetworkBuilder builder = null;
    try {
      File modelDir = mApplication.getApplicationContext().getExternalFilesDir("models");
      File file = new File(modelDir, modelName);

      builder = new SNPE.NeuralNetworkBuilder(mApplication)
              .setDebugEnabled(false)
              .setRuntimeOrder(NeuralNetwork.Runtime.DSP)
              .setModel(file)
              .setCpuFallbackEnabled(true)
              .setUseUserSuppliedBuffers(true);
    } catch (IllegalStateException e) {
      Log.e("SNPE", e.getMessage(), e);
    } catch (IOException e) {
      e.printStackTrace();
    }

    NeuralNetwork mNeuralNetwork = builder.build();

    final String inputLayer = mNeuralNetwork.getInputTensorsNames().iterator().next();
final FloatTensor tensor = mNeuralNetwork.createFloatTensor(
        mNeuralNetwork.getInputTensorsShapes().get(inputLayer));
float[] input = loadRgbBitmapAsFloat(bitmap);
final Map<String, FloatTensor> inputs = new HashMap<>();
tensor.write(input, 0, input.length);
inputs.put(inputLayer, tensor);

mNeuralNetwork.execute(inputs);

It really works.However,I found that the result after execute has only one node:detection_classes:0,no detection_boxes and detection_scores.

I wonder why and how should I get the correct result? Thanks

  • Up0
  • Down0

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.