1

As the new version of neuroph core is deprecated it is not able to load a neural network file named m.nnet which then throws an exception as shown:

org.neuroph.core.exceptions.NeurophException: Class not found while trying to read neural network from file! at org.neuroph.core.NeuralNetwork.load(NeuralNetwork.java:638)

the code which used to load this file was:

 InputStream irs = getResources().openRawResource(R.raw.m); net = NeuralNetwork.load(irs); 

where m file is stored in raw folder.

now after following this link http://neuroph.sourceforge.net/javadoc/org/neuroph/core/NeuralNetwork.html#load-java.lang.String-

they say that we need to use createFromFile() instead of load()

please help me to understand how to load the m.nnet file using createFromFile() method. Thank You!

3
  • One thing is for sure that exceptions are meant to be generate, so handle it within try-catch block for ClassNotFoundException. This is the least you can do. Commented Jan 9, 2019 at 7:18
  • Just to make sure. Is your m file in the res/raw folder? stackoverflow.com/questions/5777413/… Commented Jan 9, 2019 at 7:41
  • @AlexanderHoffmann yes sir it is under res/raw folder it compiles properly and throws a runtime error then Commented Jan 9, 2019 at 8:49

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.