mrousavy / react-native-fast-tflite

🔥 High-performance TensorFlow Lite library for React Native with GPU acceleration
https://mrousavy.com
MIT License
732 stars 41 forks source link

Failed to create TFLite interpreter (with "android-gpu" parameter #113

Closed Eliya-Shalom closed 2 hours ago

Eliya-Shalom commented 2 hours ago

React native - expo bare - android

Did someone faced the following issue while trying to load tflite model with "android-gpu" parameter? (react-native-fast-tflite)

  private readonly MODEL_PATH = require("@/assets/models/Real-ESRGAN-x4plus.tflite");
  this.model = await loadTensorflowModel(this.MODEL_PATH, "android-gpu");

ERROR Error loading TFLite model: [Error: Failed to create TFLite interpreter from model "[http://192.168.1.114:8081/assets/?unstable_path=.%2Fassets%2Fmodels/Real-ESRGAN-x4plus.tflite?platform=android&hash=91578c063c5f697f53d321559107e49d"!](http://192.168.1.114:8081/assets/?unstable_path=.%2Fassets%2Fmodels/Real-ESRGAN-x4plus.tflite?platform=android&hash=91578c063c5f697f53d321559107e49d%22!)]

I tried with Real-ESRGAN-x4plus.tflite from the offical qualcomm hugging face page (https://huggingface.co/qualcomm), and also qualcomm/MediaPipe-Hand-Detection just to test another model but its failing as well.

any idea?

maintenance-hans[bot] commented 2 hours ago

Guten Tag, Hans here.

It seems like you did not provide enough information for us to assist you properly. Could you please include relevant logs from Android Studio or use adb logcat to gather logs when you encounter the error? This will help mrousavy understand ze issue better.

Also, if you find ze project helpful, consider sponsoring it here to get more attention. Vielen Dank! 🍻

Note: If you think I made a mistake by closing this issue, please ping @mrousavy to take a look.

Eliya-Shalom commented 2 hours ago

11-25 11:44:45.565 4209 4320 D EGL_emulation: eglCreateContext: 0x7f0ca68d8ad0: maj 3 min 1 rcv 4 11-25 11:44:45.657 4209 4320 D EGL_emulation: eglMakeCurrent: 0x7f0ca68d8ad0: ver 3 1 (tinfo 0x7f0ec7671180) (first time) 11-25 11:44:45.669 4209 4320 E tflite : TfLiteGpuDelegate Init: Batch size mismatch, expected 1 but got 3 11-25 11:44:45.670 4209 4320 I tflite : Created 0 GPU delegate kernels. 11-25 11:44:45.670 4209 4320 E tflite : TfLiteGpuDelegate Prepare: delegate is not initialized 11-25 11:44:45.670 4209 4320 E tflite : Node number 1028 (TfLiteGpuDelegateV2) failed to prepare. 11-25 11:44:45.674 4209 4320 E tflite : Restored original execution plan after delegate application failure. 11-25 11:44:45.693 4209 4280 E ReactNativeJS: 'Error loading TFLite model:', [Error: Failed to create TFLite interpreter from model "http://192.168.1.114:8081/assets/?unstable_path=.%2Fassets%2Fmodels/Real-ESRGAN-x4plus.tflite?platform=android&hash=91578c063c5f697f53d321559107e49d"!]