What is the way to save / load an instance of ANN_MLP in java.

asked 2016-02-18 15:34:22 -0500

I've built some neural network using ANN_MLP java classes, everything works fine, excepts that I cant find any working method to save / load trained networks. I'm using opencv 3.1.0 in Java. I've tried the exposed ANN_MLP.save (String filename) method (inherited from Algorithm), but it crash the jvm, and for the loading there is nothing ! What are the right process to I/O trained networks ? Thanks.

edit retag flag offensive close merge delete


As i tried, I call the JNI to load the model in c++, you can have a look at this link if you are still stuck at this problem:link text
After loading every Parameters of MLP is OK, but I've no idea how to save it in Java in converting the MLP pointer to jlong. Alternative I'm trying to use android sdk 2.4.11, for there is a load function available just like below Shows:

public  void load(String filename, String name)

    load_0(nativeObj, filename, name);


I'll post it again if it works. Jian

Jian.Xi gravatar imageJian.Xi ( 2016-03-30 06:35:59 -0500 )edit