flutter-tflite icon indicating copy to clipboard operation
flutter-tflite copied to clipboard

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

Open hzhongresearch opened this issue 1 year ago • 4 comments

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 https://github.com/tensorflow/flutter-tflite/issues/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?

hzhongresearch avatar Sep 13 '24 03:09 hzhongresearch

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?

olion500 avatar Oct 10 '24 02:10 olion500

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

hzhongresearch avatar Oct 10 '24 07:10 hzhongresearch

I am facing same issue
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? despite updating to def tflite_version = "2.16.1"

git-code11 avatar Dec 18 '24 18:12 git-code11

do the same for IOS edit the tflite_flutter.podspec

tflite_version = '2.17.0'

kelvinu avatar Jan 05 '25 00:01 kelvinu