examples icon indicating copy to clipboard operation
examples copied to clipboard

Model Personalization for Digit Classifier Application

Open Ashok-Kumar-dharanikota opened this issue 2 years ago • 2 comments

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.

Ashok-Kumar-dharanikota avatar Mar 16 '23 09:03 Ashok-Kumar-dharanikota

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.

google-cla[bot] avatar Mar 16 '23 09:03 google-cla[bot]

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.

ArtanBerisha1 avatar Nov 08 '23 09:11 ArtanBerisha1