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!

shirowww
  • 533
  • 4
  • 18
  • 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. – Jeel Vankhede Jan 09 '19 at 07:18
  • Just to make sure. Is your `m` file in the `res/raw` folder? https://stackoverflow.com/questions/5777413/android-raw-folders-creation-and-reference – Alexander Hoffmann Jan 09 '19 at 07:41
  • @AlexanderHoffmann yes sir it is under res/raw folder it compiles properly and throws a runtime error then – Aakash Birari Jan 09 '19 at 08:49

0 Answers0