shaqian / flutter_tflite

Flutter plugin for TensorFlow Lite
https://pub.dartlang.org/packages/tflite
MIT License
633 stars 408 forks source link

MissingPluginException(No implementation found for method loadModel on channel tflite) #298

Open mohamed3laily opened 4 months ago

mohamed3laily commented 4 months ago

i'm stuck with this error "MissingPluginException(No implementation found for method loadModel on channel tflite) while using tensorflow lite on flutter" , i use the latest version of tflite ^1.1.2 and my model path is correct ... this is my loading code :

void loadModel() async {
    try {
      print("Attempting to load model...");
      String? res = await Tflite.loadModel(
        model: "assets/model.tflite",
        labels: "assets/labels.txt",
      );
      if (res == null || res.isEmpty) {
        throw Exception("Failed to load model");
      }
      print("Result of loadModel: $res");
      setState(() {
        isModelLoaded = true;
      });
    } catch (e) {
      print("Error loading model: $e");
    }
  }
vkprogrammer-001 commented 2 months ago

I am also facing the same problem. Have you found any solution for it? @mohamed3laily

mohamed3laily commented 2 months ago

No but i found a library called tflite_flutter and it's more stable

On Sat, Aug 10, 2024, 6:32 PM vipin kumar @.***> wrote:

I am also facing the same problem. Have you found any solution for it? @mohamed3laily https://github.com/mohamed3laily

— Reply to this email directly, view it on GitHub https://github.com/shaqian/flutter_tflite/issues/298#issuecomment-2282187376, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHDUGGCTKDGBOPBOYFUBC2LZQYXALAVCNFSM6AAAAABJV55QDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBSGE4DOMZXGY . You are receiving this because you were mentioned.Message ID: @.***>

sumn2u commented 1 month ago

I made some updates and created my own version, which I applied to my app.

You can find the updated version here.