Skip to content
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

Allow the selection of TFLite version when flutter-tflite is downloaded from pub.dev #250

Open
hzhongresearch opened this issue Sep 13, 2024 · 2 comments

Comments

@hzhongresearch
Copy link

Trying to run a model on an Android device using flutter-tflite 0.11.0 and getting the following error.
Didn't find op for builtin opcode 'LOG' version '2'. An older version of this builtin might be supported. Are you using an old TFLite binary with a newer model?

Changing line 64 in flutter-tflite/android/build.gradle
from
def tflite_version = "2.11.0"
to
def tflite_version = "2.16.1"
fixes the issue.

In the following related issue #73 people have problems with newer version of TFLIte. To accommodate everyone, would it be possible to make the TFLite version configurable when plugin is downloaded from pub.dev?

@olion500
Copy link

I also got similar error when I tried to run whisper.
Didn't find op for builtin opcode 'FULLY_CONNECTED' version '12'. An older version of this builtin might be supported. Are you using an old TFLite binary with a newer model?

How do you change flutter-tflite/android/build.gradle from your flutter app?

@hzhongresearch
Copy link
Author

I also got similar error when I tried to run whisper. Didn't find op for builtin opcode 'FULLY_CONNECTED' version '12'. An older version of this builtin might be supported. Are you using an old TFLite binary with a newer model?

How do you change flutter-tflite/android/build.gradle from your flutter app?

Hi,
It is not possible to change flutter-tflite/android/build.gradle from within your own app.

Instead clone the latest version of flutter-tflite to your computer and change the TFLite version number within flutter-tflite/android/build.gradle on your computer.

Then within your own app change the line for tflite_flutter in pubspec.yaml from

tflite_flutter: ^0.11.0

to

tflite_flutter:
    path: <dir on your computer containing your local copy of flutter-tflite>/flutter-tflite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants