Caused by: java.lang.IllegalArgumentException: Cannot copy from a TensorFlowLite tensor (MobilenetV1/Predictions/Reshape_1) with shape [1, 1001] to a Java object with shape [1, 1001, 4]. #123345
Unanswered
Sk-Mattes
asked this question in
Programming Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
I have a Flutter project in which an image is stored as a jpeg on the local storage. However, I always get an error as soon as I try to run the tflite model on the image. I would appreciate some help!
Kind regards!
Log with Error:
FATAL EXCEPTION: AsyncTask https://github.com/orgs/community/discussions/2
E/AndroidRuntime( 7781): Process: de.seekamp.security_system_software, PID: 7781
E/AndroidRuntime( 7781): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime( 7781): at android.os.AsyncTask$3.done(AsyncTask.java:353)
E/AndroidRuntime( 7781): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime( 7781): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime( 7781): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime( 7781): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
E/AndroidRuntime( 7781): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E/AndroidRuntime( 7781): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E/AndroidRuntime( 7781): at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime( 7781): Caused by: java.lang.IllegalArgumentException: Cannot copy from a TensorFlowLite tensor (MobilenetV1/Predictions/Reshape_1) with shape [1, 1001] to a Java object with shape [1, 1001, 4].
E/AndroidRuntime( 7781): at org.tensorflow.lite.TensorImpl.throwIfDstShapeIsIncompatible(TensorImpl.java:464)
E/AndroidRuntime( 7781): at org.tensorflow.lite.TensorImpl.copyTo(TensorImpl.java:226)
E/AndroidRuntime( 7781): at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:278)
E/AndroidRuntime( 7781): at org.tensorflow.lite.InterpreterImpl.runForMultipleInputsOutputs(InterpreterImpl.java:101)
E/AndroidRuntime( 7781): at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:95)
E/AndroidRuntime( 7781): at sq.flutter.tflite.TflitePlugin$RunSSDMobileNet.runTflite(TflitePlugin.java:710)
E/AndroidRuntime( 7781): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:507)
E/AndroidRuntime( 7781): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:481)
E/AndroidRuntime( 7781): at android.os.AsyncTask$2.call(AsyncTask.java:333)
E/AndroidRuntime( 7781): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime( 7781): ... 4 more
My Code:
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions