shaqian / flutter_realtime_detection

Real-time detection demo for Flutter tflite plugin
842 stars 301 forks source link

Custom tflite model not working #16

Open EshwarMuthu opened 5 years ago

EshwarMuthu commented 5 years ago

Hi @shaqian, I am trying to build a yoga pose detector application. I have got the tflite model from https://github.com/smellslikeml/YogAI. Model name is model.tflite. I inserted the model in assests folder and added it in pubspec.yaml and also I have changed my model path in loadModel function in home.dart file. I called the runModelOnFrame function in camera.dart file. But I am getting error. Can u please help me with this. This is the error I got: _E/AndroidRuntime( 4091): FATAL EXCEPTION: AsyncTask #2 E/AndroidRuntime( 4091): Process: com.example.aiproject, PID: 4091 E/AndroidRuntime( 4091): java.lang.RuntimeException: An error occurred while executing doInBackground() E/AndroidRuntime( 4091): at android.os.AsyncTask$3.done(AsyncTask.java:354) E/AndroidRuntime( 4091): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383) E/AndroidRuntime( 4091): at java.util.concurrent.FutureTask.setException(FutureTask.java:252) E/AndroidRuntime( 4091): at java.util.concurrent.FutureTask.run(FutureTask.java:271) E/AndroidRuntime( 4091): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) E/AndroidRuntime( 4091): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/AndroidRuntime( 4091): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/AndroidRuntime( 4091): at java.lang.Thread.run(Thread.java:764) E/AndroidRuntime( 4091): Caused by: java.lang.IllegalArgumentException: Null outputs are allowed only if the Tensor is bound to a buffer handle. E/AndroidRuntime( 4091): at org.tensorflow.lite.Tensor.copyTo(Tensor.java:147) E/AndroidRuntime( 4091): at org.tensorflow.lite.NativeInterpreterWrapper.run(NativeInterpreterWrapper.java:183) E/AndroidRuntime( 4091): at org.tensorflow.lite.Interpreter.runForMultipleInputsOutputs(Interpreter.java:275) E/AndroidRuntime( 4091): at org.tensorflow.lite.Interpreter.run(Interpreter.java:249) E/AndroidRuntime( 4091): at sq.flutter.tflite.TflitePlugin$RunModelOnFrame.runTflite(TflitePlugin.java:513) E/AndroidRuntime( 4091): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:419) E/AndroidRuntime( 4091): at sq.flutter.tflite.TflitePlugin$TfliteTask.doInBackground(TflitePlugin.java:393) E/AndroidRuntime( 4091): at android.os.AsyncTask$2.call(AsyncTask.java:333) E/AndroidRuntime( 4091): at java.util.concurrent.FutureTask.run(FutureTask.java:266) E/AndroidRuntime( 4091): ... 4 more I/Process ( 4091): Sending signal. PID: 4091 SIG: 9 Lost connection to device. Exited (sigterm)

hritik7080 commented 4 years ago

I am also getting the same error with my custom weapon detection model. @shaqian Can you please help me with that?