flutter-tflite icon indicating copy to clipboard operation
flutter-tflite copied to clipboard

Failed to decode image

Open Rikerz08 opened this issue 1 year ago • 2 comments

hi! im trying to create a Object detection application using this repo https://github.com/tensorflow/flutter-tflite. T tried to use my custom model and it gave me an error

and right now im facing this error

[log] Running inference...
[log] Processing outputs...
[log] Unexpected structure for scores: 10.0
[log] Locations: [[-1, -1, 297, 295], [3, -2, 10, 76], [3, 286, 60, 295], [3, 257, 11, 305], [292, 1, 296, 61], [291, 0, 297, 17], [2, 185, 14, 314], [192, 281, 302, 293], [286, 287, 299, 299], [3, 283, 16, 297]]
[log] Classes: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]

E/FlutterJNI(20808): Failed to decode image
E/FlutterJNI(20808): android.graphics.ImageDecoder$DecodeException: Failed to create image decoder with message 'unimplemented'Input contained an error.
E/FlutterJNI(20808):     at android.graphics.ImageDecoder.nCreate(Native Method)
E/FlutterJNI(20808):     at android.graphics.ImageDecoder.-$$Nest$smnCreate(Unknown Source:0)
E/FlutterJNI(20808):     at android.graphics.ImageDecoder$ByteBufferSource.createImageDecoder(ImageDecoder.java:242)

do you have any suggestions on how i can solve this problem?

here is the code https://paste.ofcode.org/rU2SuxZyhyWguQZxhBaSuE

Rikerz08 avatar Dec 22 '23 14:12 Rikerz08

@Rikerz08 When you mention a problem like this, what is your "custom model"? Is your problem specific enough in context for other maintainers and contributors to look into? To be honest, not a lot of people are contributing to this repo right now so general questions will be disregarded. My guess is that your input tensor, image format (your image must be in JPEG or PNG form) have something to do with this error? Double check the debugger's logs as well since there might be more hints for you to solve your very own problem.

qu-ngx avatar Jan 18 '24 03:01 qu-ngx

The link doesn't work Can you show a minimal reproducible example?

saurabhkumar8112 avatar Jan 20 '24 10:01 saurabhkumar8112