Skip to content

Desirializing a model causes InvalidClassExeption #1

@waleedlutfi90

Description

@waleedlutfi90

Deserializing a serialized model produces the following error:

java.io.InvalidClassException: 
    weka.classifiers.trees.RandomForest; Incompatible class (SUID): 
    weka.classifiers.trees.RandomForest

I tried the following 2 methods provided in the wiki for the project:

//First Method
RandomForest rf = (RandomForest) weka.core.SerializationHelper.
    read(Environment.getExternalStorageDirectory().getPath() + "/BC.model");

//Second Method
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(
    Environment.getExternalStorageDirectory().getPath() + "/BC.model"));
RandomForest rf = new RandomForest();
rf = (RandomForest) ois.readObject();

Note: I use WEKAstripped.jar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions