-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choosing the layer to retrieve embeddings from: allocate_tensors error, when using tensorflow 2.17.0 #531
Comments
You answered your own question, we currently only support TF 2.15.x, there are breaking changes in TF 2.16 that affect our model loading and saving. |
I would like to help to solve the problem, as I'm having the same issue while extending the API, but downgrading my Linux development environment from Python 3.12, which doesn't support this outdated TF version, seems quite complicated. Unfortunately, I have no idea where to start, so perhaps we should meet next year and talk about a solution, Josef. |
Happy new year. :) I'm back to work and played around with TensorFlow for some while. As it seems we are only using TensorFlow Lite, I did some research and discovered it got renamed to AI Edge LiteRT [1]. Just set the Interpreter-parameter [3] "experimental_preserve_all_tensors" to "True" and the embeddings can be extracted as before. As this parameter exists (with default value of "False") since TensorFlow 2.5 [4], I'm wondering why it worked until 2.15. So there may be other incompatibilities, but it seems to work for me, so give it a try. [1] https://ai.google.dev/edge/litert |
Describe the bug
When I use the tflite Interpreter object, I used to be able to get both embeddings and class logits in the same way as done in this code base:
To Reproduce
I have tensorflow 2.17. I actually tried with tensorflow 2.15 and it worked fine, but I need to use tensorflow 2.16 or 2.17 for compatibility with my CUDA version 12.3 re this table https://www.tensorflow.org/install/source#gpu
Expected behavior
Can retrieve embedding (feature) values from output_details['index']-1 layer using tf_model.get_tensor()
How do I need to modify the code so that the tflite interpreter can be used with TensorFlow 2.17?
Thanks
The text was updated successfully, but these errors were encountered: