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

IllegalArgumentException on running the tflite model on Android

Open Gojo1729 opened this issue 3 years ago • 1 comments

Hi, I have a person segmentation model which I have converted to Tflite file, while running this model on some Android phones I am getting these errors -

Fatal Exception: java.lang.IllegalArgumentException
Internal error: Failed to run on the given Interpreter: Input tensor 995 lacks data
Fatal Exception: java.lang.IllegalArgumentException
Internal error: Failed to run on the given Interpreter: Input tensor 869 lacks data
Fatal Exception: java.lang.IllegalArgumentException
Internal error: Failed to run on the given Interpreter: Invalid tensor index 0 (not in [0, 0)) Node number 313 (LOGISTIC) failed to invoke.

I can share the tflite model over the mail if needed.

Gojo1729 avatar Feb 21 '22 07:02 Gojo1729

For the first two errors, it seems that you didn't feed in input data for tensor 995 and tensor 869. You can open your model in https://lutzroeder.github.io/netron/ and check what the inputs/outputs are. Make sure you feed data for every input/output tensor.

For the third error, it seems that the model was not converted correctly. The error message should come from here, when it's validating the tensors in the graph. Having max_size as 0 is weird.

lu-wang-g avatar Feb 22 '22 23:02 lu-wang-g