@cpoohee Thanks for the reply, while I was experimenting yesterday, I ended up writing the pre-processing model using tensorflow text, but it still had the same problem my guess is this as you mentioned. Also I don’t think experimental_enable_resource_variable helped not that I expected it to but still



 cpoohee:

Secondly, if you are using preprocessor = hub.KerasLayer("https://tfhub.dev/tensorflow/bert_en_uncased_preprocess/3") or similar tokenizer helper layers that depends on tensorflow-text, you will have difficulties compiling mobile tflite binaries that support tensorflow-text ops as flex delegate ops. See Using tensorflow_text with tflite. · Issue #287 · tensorflow/text · GitHub 


I was wondering which custom ops that tensorflow text uses you replaced as there are quite a few of them, it would save me time for me to identify which ops work and which don’t for tflite because currently I don’t even know how to identify them, I need to research that first.



 cpoohee:

If you are already using c++ ndk sentence piece, it might be much neater to remain that way until the above issues are fixed.


This might be true as I don’t know the level of jank I need to pull off to offload this to the model lol. But currently I am trying to eliminate usage of ndk as it inflates project complexity wayyyy too much than I would like as I am shifting to flutter, I removed any other use case that can be made in c++ and wrote them natively, only part left is this.