am15h / tflite_flutter_plugin

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

How to change TensorFlow version for iOS? #99

Closed mspnr closed 3 years ago

mspnr commented 3 years ago

I am using a model created for TFLite 2.3 and getting the error when running the app on iOS:

Didn't find op for builtin opcode 'RESIZE_NEAREST_NEIGHBOR' version '3'
Registration failed.

I've managed to fix this error for Android by replacing *.so files from release using install script as recommended in Readme.

But I can't figure out how to switch TFLite version for iOS. In Readme it is said, that the original API is dynamically linked as TensorFlowLiteC.framework. Should I update something there?

mspnr commented 3 years ago

Ok. I've managed to start the model on iOS.

To do that I placed the updated TensorFlowLiteC.framework to the directory FLUTTER_DIR/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-0.5.0/ios/TensorFlowLiteC.framework (just replaced the directory).

I would suggest to add the way to update the framework to Readme or somehow automatise that with e.g. install script.

am15h commented 3 years ago

Let's track this here https://github.com/am15h/tflite_flutter_plugin/issues/110.