-
Notifications
You must be signed in to change notification settings - Fork 74k
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
TensorFlow Lite Inference Crash with tf.reverse(x, axis=[])
#62679
Comments
I am able to replicate w/ the same gist, I should note that tf.reverse(x, axis=[]) is effectively a non-op. @ganler, Is that what you intended? I.e. you are saying reverse no axes. |
Yes the usage leading to a crash is reverse of no axes and it is a non-op. I am reporting it as a bug here as it unexpectedly crashed the Python program leading to inconveniences in an automated model generation pipeline. Maybe it is better to just eliminate the non-op and move on instead of crash without errors. :) |
No worries, just wanted to ensure you are able to continue w/ your work while we investigate this case, @nutsiepully can you please take a look? Thanks. |
Hi @ganler , if you are able to access a linux system you may be able to resolve your issue by using AI-Edge-Torch, you can find more information here: googleblog. I have actually created a simple script for converting your model here: import torch
import torch.nn as nn
import ai_edge_torch
class Foo(nn.Module):
def __init__(self):
super(Foo, self).__init__()
def forward(self, x):
return torch.flip(x, dims=[])
foo = Foo()
sample_input = (torch.randn(1),)
# Convert the model using AI Edge Torch
edge_model = ai_edge_torch.convert(foo.eval(), sample_input)
# Export the model to TFLite format
edge_model.export('foo_model.tflite') If you want to, you can actually try visualizing the result in model-explorer as well. Please try them out and let us know if this resolves your issue. If you still need further help, feel free to open a new issue at the respective repo. |
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. |
1. System information
pip install tf-nightly
where python is 3.92. Code
Colab link: https://colab.research.google.com/drive/1gAsclHMWEf9in0wkF-y1nIbbFrh1m11V?usp=sharing
3. Failure after conversion
Converted model crash at inference and the model is fully valid.
The text was updated successfully, but these errors were encountered: