react-native-fast-tflite icon indicating copy to clipboard operation
react-native-fast-tflite copied to clipboard

Error: Failed to create TFLite interpreter from model

Open Swikriti0998 opened this issue 9 months ago • 6 comments

I am trying to load the tensor flow model but its giving me the below error, I have my pose-detection.tflite in assets/pose-detection

error: Failed to load Tensorflow Model 3! [Error: Failed to create TFLite interpreter from model "http://192.168.1.10:8081/assets/?unstable_path=.%2Fassets%2Fpose-detection/pose-detection.tflite?platform=ios&hash=361a28992b649751d6d66cd8cfb1e2a6"!]

I tried both true and false inside the app.config.ts file.

'react-native-fast-tflite', { enableCoreMLDelegate: false/true, }

Swikriti0998 avatar May 13 '24 19:05 Swikriti0998

I do believe you have to edit your metro.config.js file to configure your project to be able to interoperate .tflite files.

Try adding this code to metro.config.js:


config.resolver.assetExts.push(
    'tflite'
);

vmelentev avatar May 13 '24 19:05 vmelentev

Already edited my metro config and it's reading the tflite file otherwise it would give below error. error - Unable to resolve "@assets/pose-detection/pose-detection.tflite" from "src/screens/home/index.tsx"

However while loading the application I am getting the below error error - {"error": [Error: CoreML Delegate is not enabled! Set $EnableCoreMLDelegate to true in Podfile and rebuild.], "model": undefined, "state": "error"}

Swikriti0998 avatar May 15 '24 09:05 Swikriti0998

did you rebuild pods & rebuild your app after enabling the core ml delegate?

mrousavy avatar May 15 '24 09:05 mrousavy

Hello, @Swikriti0998 did you solve this ? I encounter the exact same issue.

juv85 avatar Aug 09 '24 16:08 juv85

@mrousavy, yes. Cleared cache build the app again but same error.

@juv85, no I couldn't.

Swikriti0998 avatar Sep 20 '24 13:09 Swikriti0998

@Swikriti0998 what framework did you use to build your model? For my case I realized that fine tuned models trained with anything other than tensorflow model maker throw this error.

After researches I saw this is related to the model's architecture. This library doesn't seem to take different model architectures into account for the moment (I might be wrong but this is my understanding)

juv85 avatar Sep 20 '24 13:09 juv85