Need help tflite image classification for swift in float32

I have followed the (iOS hızlı başlangıç, iOS hızlı başlangıç  |  TensorFlow Lite) tensorflow ios quickstart guide and am able to successfully run a tflite classification efficientnet(uint8 input and output) model in ios using swift code. But when I try to replace the model with another model(float32 input and output, trained by me), i get the following error code

Failed to create the interpreter with error: NOT_FOUND: Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images.

Would like to get some help on how to change the code so that my float32 tflite model will work

link to the imageclassificationhelper.swift file (examples/ImageClassificationHelper.swift at master · tensorflow/examples · GitHub)

1 Like

This issue is solved. I have converted my model from my float32 without metadata to a float32 model with meta data and without any code changes, this model started working directly in my application. I have followed tensorflow’s creation of meta data with normalisation options tutorial from their official website.

2 Likes

I encountered this while using the tflite from LobeAI. How exactly were you able to convert the model? Please enlighten me, I’m currently in our thesis for image classification. Thanks!