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

Exported TFlite Model isn't working with Flutter #4

Closed
snehitvaddi opened this issue Dec 11, 2020 · 2 comments
Closed

Exported TFlite Model isn't working with Flutter #4

snehitvaddi opened this issue Dec 11, 2020 · 2 comments

Comments

@snehitvaddi
Copy link

Hey there!!
I have tried training my dataset using the Lobe.ai tool and after exporting it to the TFlite model, I tested it out with my prototype app but it is throwing an error related to the unsupported format as given below.

IllegalArgumentException: Cannot convert between a TensorFlowLite tensor with type STRING and a Java object of type [[F (which is compatible with the TensorFlowLite type FLOAT32).

I knew you are yet to release a stable version for Android export but as a proactive effort, could you please help me out resolving this issue?

@snehitvaddi
Copy link
Author

Hey!!
I have updated my lobe.ai application and this time, my app is running smoothly but the tflite model is returning the same prediction with any kind of input on my Flutter App.

May I know, why is this happening??

You have a look at my flutter app code here: Flutter APP

@mbeissinger
Copy link
Contributor

Hi! I don't believe this is related to the Image Tools app here, which operates entirely in Python, so going to close the issue. I'd recommend posting to Reddit (https://reddit.com/r/lobe) for some more traction and visibility. I'm also not familiar with Flutter, but the exported models expect the input images to be arrays of pixel values described in the signature.json file (most likely [1, 224, 224, 3] shaped float32 array of rgb pixels, where the float32 pixel values are between 0-1 instead of 0-255). For all the preprocessing steps, check out the sample code exported with the TFLite model in the example/ subdirectory from the Lobe export.

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

2 participants