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

E/AndroidRuntime(10989): Caused by: java.lang.IllegalArgumentException: Cannot copy to a TensorFlowLite tensor (serving_default_conv2d_3_input:0) with 90000 bytes from a Java Buffer with 67500 bytes. #293

Open
Ahmed-Hamdy-911 opened this issue Apr 22, 2024 · 0 comments

Comments

@Ahmed-Hamdy-911
Copy link

Ahmed-Hamdy-911 commented Apr 22, 2024

Can anyone help me please when upload the image to the model the application crashes and closes and gives me this error i used flutter

E/AndroidRuntime(10989): FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime(10989): Process: com.example.graduation_project, PID: 10989
E/AndroidRuntime(10989): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime(10989): at android.os.AsyncTask$4.done(AsyncTask.java:415)
E/AndroidRuntime(10989): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime(10989): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime(10989): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime(10989): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
E/AndroidRuntime(10989): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(10989): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(10989): at java.lang.Thread.run(Thread.java:923)
E/AndroidRuntime(10989): Caused by: java.lang.IllegalArgumentException: Cannot copy to a TensorFlowLite tensor (serving_default_conv2d_3_input:0) with 90000 bytes from a Java Buffer with 67500 bytes.
E/AndroidRuntime(10989): at org.tensorflow.lite.TensorImpl.throwIfSrcShapeIsIncompatible(TensorImpl.java:426)
E/AndroidRuntime(10989): at org.tensorflow.lite.TensorImpl.setTo(TensorImpl.java:150)
E/AndroidRuntime(10989): at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:260)
E/AndroidRuntime(10989): at org.tensorflow.lite.InterpreterImpl.runForMultipleInputsOutputs(InterpreterImpl.java:101)
E/AndroidRuntime(10989): at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:95)
E/AndroidRuntime(10989): at org.tensorflow.lite.InterpreterImpl.run(InterpreterImpl.java:94)
E/AndroidRuntime(10989): at org.tensorflow.lite.Interpreter.run(Interpreter.java:95)
E/AndroidRuntime(10989): at sq.flutter.tflite.TflitePlugin$RunModelOnImage.runTflite(TflitePlugin.java:504)
E/AndroidRuntime(10989): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:471)
E/AndroidRuntime(10989): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:445)
E/AndroidRuntime(10989): at android.os.AsyncTask$3.call(AsyncTask.java:394)
E/AndroidRuntime(10989): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(10989): ... 4 more
I/Process (10989): Sending signal. PID: 10989 SIG: 9
Lost connection to device.

@Ahmed-Hamdy-911 Ahmed-Hamdy-911 changed the title Can anyone help me please when upload the image to the model the application crashes and closes and gives me this error i used flutter E/AndroidRuntime(10989): Caused by: java.lang.IllegalArgumentException: Cannot copy to a TensorFlowLite tensor (serving_default_conv2d_3_input:0) with 90000 bytes from a Java Buffer with 67500 bytes. Apr 22, 2024
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

1 participant