MatrixMultiLayerPeceptron not serializable

Help
Barry NL
2012-06-11
2012-12-24
  • Barry NL
    Barry NL
    2012-06-11

    Hello,

    When I try to save a MatrixMultiLayerPerceptron (Neuroph version 2.6), our application throws the following exception:

    java.io.NotSerializableException: org.neuroph.contrib.matrixmlp.MatrixInputLayer
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
        at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1362)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1170)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
        at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
        at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
        at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
        at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
        at org.neuroph.core.NeuralNetwork.save(NeuralNetwork.java:566)
            .
            .
            .
        at java.lang.Thread.run(Thread.java:679)
    

    The MatrixInputLayer does indeed not implement the Serializable interface. Any ideas how to save or circumvent this and correctly save a MatrixMultiLayerPerceptron?

    Thanks in advance,

    Barry NL

     
  • Barry NL
    Barry NL
    2012-06-11

    Letting MatrixInputLayer and MatrixMlpLayer implement the Serializable interface solved it. I propose to add those in a next release of neuroph.