am15h / tflite_flutter_plugin

TensorFlow Lite Flutter Plugin
https://pub.dev/packages/tflite_flutter
Apache License 2.0
508 stars 353 forks source link

ios: Failed to lookup symbol (dlsym(RTLD_DEFAULT, TfLiteGpuDelegateOptionsV2Default): symbol not found) #60

Closed jaweii closed 3 years ago

jaweii commented 3 years ago
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B50 darwin-x64, locale zh-Hans-CN)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[!] Android Studio (version 4.0)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.52.1)
[✓] Connected device (2 available)

! Doctor found issues in 2 categories.
    final gpuDelegate = GpuDelegateV2();
    var interpreterOptions = InterpreterOptions()..addDelegate(gpuDelegate);
    interpreter = await Interpreter.fromAsset(
      'ml/yolov4-tiny-1280-final.tflite',
      options: interpreterOptions,
    );

HELP PLEASE!

am15h commented 3 years ago

Can you please try running sh install.sh -d at the root of your project. This should fix your problem.

jaweii commented 3 years ago

I have already run it and it is NOT working. I am running in the simulator on mac. Is this only working for Android?

------------------ Original ------------------ From: Amish Garg <notifications@github.com> Date: Tue,Dec 22,2020 5:04 AM To: am15h/tflite_flutter_plugin <tflite_flutter_plugin@noreply.github.com> Cc: 朱嘉伟 <1005945485@qq.com>, Author <author@noreply.github.com> Subject: Re: [am15h/tflite_flutter_plugin] ios: Failed to lookup symbol (dlsym(RTLD_DEFAULT, TfLiteGpuDelegateOptionsV2Default): symbol not found) (#60)

Can you please try running sh install.sh -d at the root of your project. This should fix your problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

am15h commented 3 years ago

Hi @jaweii, for ios please try

https://github.com/am15h/tflite_flutter_plugin#improve-performance-using-delegate-support

Relevant APIs: https://pub.dev/documentation/tflite_flutter/latest/tflite_flutter/GpuDelegate-class.html And https://pub.dev/documentation/tflite_flutter/latest/tflite_flutter/GpuDelegateOptions-class.html

Or

https://pub.dev/documentation/tflite_flutter/latest/tflite_flutter/InterpreterOptions/useMetalDelegateForIOS.html

am15h commented 3 years ago

I am closing this issue, assuming that above resolution fixed your problem. Please feel free to reopen, if required.

shaheer20 commented 1 year ago

@am15h Having same issue i have tried both of your solutions but no luck.