-
Notifications
You must be signed in to change notification settings - Fork 353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use iOS Metal Delegate (GpuDelegate)? #100
Comments
Here is what I came up with. Building TF LiteOnce again here is the start point. The recommended option is ending up with issue tensorflow/tensorflow#48464, so no outcome here: To build version 2.4.1 and earlier I used (by adding To build the latest version for arm64 only (by replacing The second and the third options produced So I assumed, that Building GPU delegate metalUnfortunately I didn't find a way to include the So to build Enabling GPU delegate metal functionOn the next step I placed
To apply the changes I cleaned and rebuilt the flutter project: After that the error (magically) disappeared. The app is working all right and more than twice faster, than without GPU acceleration. ObservationsThe option suggested in Readme is working all right: final gpuDelegate = GpuDelegate(
options: GpuDelegateOptions(true, TFLGpuDelegateWaitType.active),
);
var interpreterOptions = InterpreterOptions()..addDelegate(gpuDelegate); The other option though mentioned here #60 (comment) and also present in the documentation is not working all right. Conclusion
|
@applikationsprogramvara Thank you so much for this great tutorial. I am including this in readme as well. |
Is there any example to prove that iOS is recognizing things? I used below function as you said but no faces is recognized at all. The app starts but no faces is recognized when you capture faces. In summary, if you know any examples to prove that iOS is working to realize faces then please let me know. Android is working but iOS. Future loadModeliOS() async { |
Please checkout @danghoaidanh https://github.com/am15h/object_detection_flutter, it works on iOS and Android both. |
Hi @applikationsprogramvara, I have added this tutorial in wiki, https://github.com/am15h/tflite_flutter_plugin/wiki/Build-iOS-binaries-with-GPU-delegate. Please review it and make edits if required. Thanks for your contribution. |
@applikationsprogramvara Can you share the |
I refer to this pr : #200 |
In case anyone has troubles with building tensorflow locally, this package contains |
It is mentioned in the Readme, that this function is available:
If I use the following parameter my app is starting and working OK:
If I use the following parameter the app is starting, but is not working:
In XCode log I see the following error:
Runner[1383:458287] flutter: Error while creating interpreter: Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, TFLGpuDelegateCreate): symbol not found)
From that I assumed, that an appropriate
TensorFlowLiteC.framework
should be used:So my question is: how to let iOS Metal Delegate work?
Do you have an appropriate and compiled
TensorFlowLiteC.framework
? Can you share it?The text was updated successfully, but these errors were encountered: