Forums - tensorflow based LSTM model - issue with output layer SNPE in android

2 posts / 0 new
Last post
tensorflow based LSTM model - issue with output layer SNPE in android
ramamoorthy.san...
Join Date: 29 Jan 18
Posts: 2
Posted: Thu, 2018-07-26 00:05

 

I have tried converting tensorflow based LSTM model. the conversion to DLC  was successfull but loading the network in android throws error  "error_code=204; error_message=Couldn't find name. None of the specified output layers exist!". 

i am not sure about the error whether it is caused by input or output layer name. but when converting to dlc format using snpe-tensorflow-to-dlc i dont see any error.

need to solve this issue.. example available?

 

  • Up0
  • Down0
gesqdn-forum
Join Date: 4 Nov 18
Posts: 184
Posted: Tue, 2019-07-16 03:07

Hi,  

The error might be because of the wrong output layer name specified while building neural network using  NeuralNetworkBuilder class. 

Build the neural network inside AsyncTask without passing output layer as the parameter as shown below:


protected NeuralNetwork doInBackground(File... params) {
    NeuralNetwork network = null;
    try {
        final SNPE.NeuralNetworkBuilder builder = new SNPE.NeuralNetworkBuilder(mApplication)
                .setDebugEnabled(false)
                .setRuntimeOrder(mTargetRuntime)// CPU/GPU/DSP
//set inputstream of tthe model
                .setModel(mInputstream, mInputstream.available()) 
                .setCpuFallbackEnabled(true)
                .setUseUserSuppliedBuffers(false);
        network = builder.build();
    } catch (IllegalStateException | IOException e) {
        Logger.e(TAG, e.getMessage(), e);
    } catch (IllegalArgumentException e) {
        Logger.d(TAG, e.getMessage());
    }
    return network;
}

The above snippet helps you in building network. Once the network is built,
output layer can be got from network.getOutputLayers() method.

Hope this helps!

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