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

Model Personalization for Digit Classifier Application #452

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Ashok-Kumar-dharanikota

Hello Everyone,

I want to implement on-device training for the digit Recognition App. I don't understand how to customize the Model Personalization for the digits training and inference. I would like to add images from the gallery and use that images to train the model. I would like to continuously train and improve the model in mobile.

I am getting some run time issues, can anyone help me to resolve this? Please

2023-03-16 15:16:37.707 28368-28427/org.tensorflow.lite.examples.transfer E/AndroidRuntime: FATAL EXCEPTION: Thread-3 Process: org.tensorflow.lite.examples.transfer, PID: 28368 java.lang.RuntimeException: Exception occurred during model training at org.tensorflow.lite.examples.transfer.TransferLearningModelWrapper.lambda$new$0$TransferLearningModelWrapper(TransferLearningModelWrapper.java:61) at org.tensorflow.lite.examples.transfer.-$$Lambda$TransferLearningModelWrapper$0a967PsxF3rxXg_r_Z2IwiK2HkA.run(Unknown Source:2) at java.lang.Thread.run(Thread.java:1012) Caused by: java.lang.IllegalArgumentException: Cannot copy to a TensorFlowLite tensor (placeholder_labels) with 320 bytes from a Java Buffer with 400 bytes. at org.tensorflow.lite.Tensor.throwIfSrcShapeIsIncompatible(Tensor.java:447) at org.tensorflow.lite.Tensor.setTo(Tensor.java:189) at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:200) at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:374) at org.tensorflow.lite.examples.transfer.api.LiteTrainHeadModel.calculateGradients(LiteTrainHeadModel.java:81) at org.tensorflow.lite.examples.transfer.api.TransferLearningModel.lambda$train$1$TransferLearningModel(TransferLearningModel.java:290) at org.tensorflow.lite.examples.transfer.api.-$$Lambda$TransferLearningModel$gj-qJeX1_hIp_JZoWfWwMuu417A.call(Unknown Source:6) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637) at java.lang.Thread.run(Thread.java:1012) 
Screenshot 2023-03-16 151551

what changes I have to do , to make Application run. I Truly appreciate your help in this.

@google-cla
Copy link

google-cla bot commented Mar 16, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ArtanBerisha1
Copy link

Hi @Ashok-Kumar-dharanikota ,
I think you should open an issue on this repo or just a question in stackoverflow, the Pull Request usually is used to improve or fix a bug in the current repo, but you are changing the model and the code based on your needs and this most likely will be rejected.
In your case I would suggest the option I mentioned above (an issue or a question in stackoverflow) and probably you can get help faster in that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review size:L CL Change Size: Large
Projects
None yet
4 participants