Skip to content
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

TFLite-Runtime now LiteRT #205

Open
roablep opened this issue Oct 3, 2024 · 0 comments
Open

TFLite-Runtime now LiteRT #205

roablep opened this issue Oct 3, 2024 · 0 comments

Comments

@roablep
Copy link

roablep commented Oct 3, 2024

Per https://developers.googleblog.com/en/tensorflow-lite-is-now-litert/

import tflite_runtime.interpreter as tflite --> import ai_edge_litert.interpreter as tflite

Maybe something as simple as this?

try:
    # Attempt to import the newer LiteRT runtime
    import ai_edge_litert.interpreter as tflite
except ImportError:
    try:
        # Fallback to the original tflite_runtime if LiteRT is unavailable
        import tflite_runtime.interpreter as tflite
    except ImportError:
        raise ImportError("Neither LiteRT nor TensorFlow Lite runtime found. Please install `ai_edge_litert` or `tflite_runtime`.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant