Open yashcfg opened 1 year ago
Not sure if this helps but when converting h5 to tflite I noticed this warning log -
2023-03-29 12:44:25.359575: W tensorflow/compiler/mlir/lite/flatbuffer_export.cc:1901] TFLite interpreter needs to link Flex delegate in order to run the model since it contains the following Select TFop(s):
Flex ops: FlexCTCGreedyDecoder, FlexMatMul, FlexTensorListFromTensor, FlexTensorListGetItem, FlexTensorListReserve, FlexTensorListSetItem, FlexTensorListStack
Details:
tf.CTCGreedyDecoder(tensor<?x?x37xf32>, tensor<?xi32>) -> (tensor<?x2xi64>, tensor<?xi64>, tensor<2xi64>, tensor<?x1xf32>) : {T = f32, blank_index = -1 : i64, device = "", merge_repeated = true}
tf.MatMul(tensor<?x1xi32>, tensor<350x1xi32>) -> (tensor<?x350xi32>) : {transpose_a = false, transpose_b = true}
tf.TensorListFromTensor(tensor<?x?x128xf32>, tensor<2xi32>) -> (tensor<!tf_type.variant<tensor<?x128xf32>>>) : {device = ""}
tf.TensorListGetItem(tensor<!tf_type.variant<tensor<?x128xf32>>>, tensor<i32>, tensor<2xi32>) -> (tensor<?x128xf32>) : {device = ""}
tf.TensorListReserve(tensor<2xi32>, tensor<i32>) -> (tensor<!tf_type.variant<tensor<?x128xf32>>>) : {device = ""}
tf.TensorListSetItem(tensor<!tf_type.variant<tensor<?x128xf32>>>, tensor<i32>, tensor<?x128xf32>) -> (tensor<!tf_type.variant<tensor<?x128xf32>>>) : {device = ""}
tf.TensorListStack(tensor<!tf_type.variant<tensor<?x128xf32>>>, tensor<2xi32>) -> (tensor<?x?x128xf32>) : {device = "", num_elements = -1 : i64}
See instructions: https://www.tensorflow.org/lite/guide/ops_select
I have a requirement where I want to detect text in my android app
I followed fine tuning the recognizer guide and trained my recognizer with borndigital dataset.
Then I created the tflite version of the prediction_model from the previous step -
I expected a little difference in the results but did not expect them to be this huge (from the logs)-
As you can see in almost every case tflite model predicted wrong whereas the original recognizer's predictions are alright.
Can you suggest what changes I can do to improve the accuracy?
If you need more info, I can provide complete code and logs. All the trainings and predictions are on Mac OSX M1 with following versions -
Thanks