Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serializing a model on PC and Deserializing it on Android #2

Open
SaraKhalifa opened this issue Jun 11, 2013 · 5 comments
Open

Serializing a model on PC and Deserializing it on Android #2

SaraKhalifa opened this issue Jun 11, 2013 · 5 comments

Comments

@SaraKhalifa
Copy link

Part of my research work is to classify sensor data on Android using Multilayer Perceptron (MLP) classifier.

I used WekaSTRIPPED to train (build) the MLP classifier on the phone and save the trained model on the sdcard by serializing it. This works fine in a small scale problem even with large training data. I mean by small scale problem that the MLP model to be trained consists of about 10 inputs (features) and 4 outputs (classes). However, when the MLP model increases to have 25 inputs and 10 outputs the building process fails on the phone. I tried to increase the heap size to 1024 m but unfortunately this doesn’t solve the problem. I also tried to build the classifier on a virtual machine but again this doesn’t solve the problem.

Another trial was to train the model using WEKA on the PC and then serialize the model to a specific place on the machine. I copied this saved model from the pc and pasted it on the sdcard of the phone. Then I deserialized this model using Weka for Android but unfortunately, the deserialization of the model fails.

My question here is do I really need to train (build) my classifier on the phone specially that my training data is supposed to be very large and even the model to be trained itself is going to be more and more complex?

Any help is greatly appreciated.

Thanks.

@georgikoemdzhiev
Copy link

Try serialising the model on a PC using the same version of WEKA you have on the phone (I believe it is Weka 3.7.3) I was able to serialise my model on PC and deserialise it successfully in my android app. :)

@feliperpv
Copy link

@georgikoemdzhiev can you show your code? I have problems with it and i'm using the same version of weka (3.8.2)

@georgikoemdzhiev
Copy link

georgikoemdzhiev commented Jul 28, 2018

@feliperpv
Copy link

feliperpv commented Jul 30, 2018

@georgikoemdzhiev Thanks for the code. I noticed you don't work with a .model file extension, you use .data, what is the difference? Because I serialise my model on my PC with .model extension and I need to deserialize it on my app. In other words I have the .arff file only on my PC. In other words, I have the .arff file only on my PC and from it I generate my .model file

@georgikoemdzhiev
Copy link

@feliperpv I can't remember why I used .data extension, unfortunately. It's been a while since my Thesis project. However, I also trained/created my model from a .arff file and then serialised it on PC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants