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

Allow full tensorflow if tflite_runtime isn't available #159

Open
mikejgray opened this issue Apr 17, 2024 · 3 comments · May be fixed by #178
Open

Allow full tensorflow if tflite_runtime isn't available #159

mikejgray opened this issue Apr 17, 2024 · 3 comments · May be fixed by #178
Labels
enhancement New feature or request

Comments

@mikejgray
Copy link
Contributor

I have a bit of a strange use case, where I'm trying to run OpenWakeWord on Apple Silicon and tflite-runtime isn't available for it. I am running tensorflow with tensorflow-metal to take advantage of the chip's capabilities, but OWW doesn't attempt to fall back to tensorflow, instead opting for onnx.

It would be nice for full tensorflow to be an option, even if it's just a configurable option with extra dependencies.

Thank you!

@mikejgray
Copy link
Contributor Author

I haven't tested extensively, but it looks like an additional except ImportError in model.py and utils.py does the trick:

from tensorflow.lite.python import interpreter as tflite

@dscripka
Copy link
Owner

That's a good solution I think, as managing dependencies across many different platforms can be quite complex. I'm hesitant to add tensorflow as a dependency for the base package as it's so large, but some logic that would attempt imports if packages are available (perhaps using find_spec) could work. I'll consider this for the next release.

@dscripka dscripka added the enhancement New feature or request label May 18, 2024
@mikejgray
Copy link
Contributor Author

Definitely no need to add tensorflow as a dependency, but supporting environments that use it would be fantastic. :)

mikejgray added a commit to mikejgray/openWakeWord that referenced this issue Jun 9, 2024
@mikejgray mikejgray linked a pull request Jun 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants