-
Notifications
You must be signed in to change notification settings - Fork 144
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
Some tweaks and improvements #49
Conversation
Nice! So we're on the same page for timelines, I'll run through the apps at some point this week. Catching up on some stuff that I pushed aside for I/O last week :) |
So I'm going to show my ignorance a bit since this is actually one of the only times I've ever needed iOS - is there anything special you had to do to get the ios samples working on your machine? I went and added my personal icloud id, then ran |
Just ran everything on Android though and damn that's cool. Good job! |
I will carry out some tests with a physical device. thanks for checking it out |
@PaulTR. I made some adjustments. The problem was that when compiling in release mode the TensorFlowLiteC/Metal symbols were not being linked. I changed the dependencies to use TensorFlowLiteSwift instead of the C version and it was resolved. |
Thank you @luiscib3r for sharing this critical improvement. I faced an issues when running IsolateInterpreter with GpuDelegateV2 enabled on my Google Pixel 6. This is the message I got Everything works fine when I use Are these normal behaviours? Cheers, |
@denny61302 Thanks for your review. I'm dealing with the same problem, the solution would be to build the interpreter and delegate in a separate isolate. But I'm still thinking of a way to integrate it with the package. I don't want to modify the Interpreter base class. All ideas are welcome. |
Yeah the GPU thread thing doesn't surprise me - it does require that the interpreter setup happen on the same thread where inference happens. It's something that I'll need to look into for fixing in this plugin since I had to do some obnoxious stuff in Android samples to make delegate switching work. One quick request: Can you look over the CI build for the needed fixes in the samples? Thanks! |
@PaulTR In the CI workflow, when you do dart pub get it downloads the package dependencies but not the example dependencies. For this reason, when passing the analyzer, errors of the type |
Ah got it. I've never used melos, but given that it is in FlutterFire, that seems like a fair solution. If you're OK adding that, I think it'd be a great addition :) Thanks! |
@PaulTR CI workflow is done. I did some tests on the fork: https://github.com/luiscib3r/flutter-tflite/actions. It's ready. |
So I am running into this issue when trying to build via
Error (Xcode): ../../lib/src/bindings/tensorflow_lite_bindings_generated.dart:2060:7: Error: The type 'TfLiteModel' must be 'base', 'final' or 'sealed' because the supertype 'Opaque' is 'base'. |
Alright so hopefully this helps :) I don't know how FFI binding works yet, but I just added 'base' before all of the 'class' objects at the bottom of the generated file and that does it, so it just needs to be done from wherever those classes are created. I'm guessing there just needs to be modifiers in front of the objects in the dart files under lib/src? Edit: I pinged someone on the Flutter team to figure this out, too, because I want to know how to run the ffi script (currently getting a message about flutter_test not existing, but that's something I'll sort out on my end). If I get that working, I can merge this and do a separate PR for the new files. |
@PaulTR maybe you need to do flutter clean and run flutter pub get again, the problem is that we returned the sdk version to support dart 2, so you may still have linked the latest version of ffi which only supports dart 3 Using the latest version of ffigen and ffi class modifiers are added automatically but it is only supported in dart 3, we would remove support for everything still in dart 2 |
Fair enough - ran all of that and still seeing the issue, but will talk with Craig Labenz in the morning :)
|
@PaulTR Good morning. I remembered that I had also increased the SDK version in the samples and forgot to update them when I made the change in the package. Maybe that's why it didn't allow you to compile. I made the adjustment, try again and let me know if it was resolved. |
Sweet, that did the trick. Thanks for putting this together! It's definitely a lot of work and something that'll be great for everyone, and I really appreciate all of your effort here. I'm going to merge this and publish. Also please send up another PR to add your name to the contributor file. |
Looks like there's one more issue with publishing this, but I'll dig into it:
Looks like it has to do with the dependency override for melos (cli_util). Working through it :) Looks like invertase runs that, so I'll reach out to them (might be a day or two before I have a response - that team is based out of London and its afternoon for them) |
Alright should be fixed in #56 |
IsolateInterpreter
to run inference in an isolate. Related to Use isolates to run inference #52 [972decf]