tflite_flutter_plugin
tflite_flutter_plugin copied to clipboard
Didn't find op for builtin opcode 'FULLY_CONNECTED' version '9'
Loading Model in Flutter
void _loadModel() async {
_interpreter = await Interpreter.fromAsset('asl.tflite');
var inputShape = _interpreter.getInputTensor(0).shape;
var outputShape = _interpreter.getOutputTensor(0).shape;
print(inputShape);
print(outputShape);
print('Load Model - $inputShape / $outputShape');
}
Conversion Code
converter = tf.lite.TFLiteConverter.from_saved_model("asl_model")
converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_ops = [
tf.lite.OpsSet.TFLITE_BUILTINS,
tf.lite.OpsSet.SELECT_TF_OPS
]
tflite_model = converter.convert()
open("asl.tflite", 'wb').write(tflite_model)
print('Model size is %f MBs.' % (len(tflite_model) / 1024 / 1024.0))
Looks like there is a version mismatch between the TensorFlow version you are using to convert and the tflite binary version.
I am using tf-nightly to build my model and convert my model into tflite file.
Please use tensorflow version 2.4.1 and follow this https://github.com/am15h/tflite_flutter_plugin/issues/101#issuecomment-821781506 to use flex delegate.
Sure will try that!
@sayannath Did it work?
I will try it asap
@sayannath Did it work?
I'm facing the same problem, it didn't work till now, is there is another fix?