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))