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?
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!