Parsing TensorFlow Lite Models (*.tflite) Easily
Easily Parse TFLite Models with Python
Install the package and use it like what you build from the TensorFlow codebase. It's recommended to install the version that same as the TensorFlow that generates the TFLite model.
pip install tensorflow==2.3.0 pip install tflite==2.3.0
The generated python package is friendly to use sometimes. We have introduce several enhancements:
- Easy import: You don't need to import every classes and funtions in
tflite(example), but instead with a sigle
- Builtin opcode helper: The opcode is encoded as digits which is hard to parse for human. Two APIs added to make it easy to use.
TensorFlow sometimes leaves compability hanlding of the TFLite model to the users.
As these are API breaking change that can be easily fixed, we do this in the
As the operator definition may change across different TensorFlow versions, this package needs to be updated accordingly. If you notice that the package is out of date, please feel free to contribute new versions. This is pretty simple, instructions as below.
- Fork the repository, and download it.
- Install additional depdendency via
pip install -r requirements.txt. And install flatbuffer compiler (you may need to manually build it).
- Generate the code for update. Tools have been prepared, there are prompt for actions.
schema.fbsfor a new version.
- Update the builtin operator mapping.
- Update the classes and functions import of submodules.
- Update the API document.
- Update the versioning in setup.py.
- Build and Test (simply
pytest) around. Don't forget to re-install the newly built
tflitepackage before testing it.
- Push your change and open Pull Request.
- The maintainer will take the responsibility to upload change to PyPI when merged.
Apache License Version 2.0 as TensorFlow's.
schema.fbs is obtained from TensorFlow directly. Maintainer of this package had tried to contact TensorFlow maintainers for licensing issues, but received no reply. Ownership or maintainship is open to transfer or close if there were any issue.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size tflite-2.4.0-py2.py3-none-any.whl (87.0 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size tflite-2.4.0.tar.gz (30.5 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for tflite-2.4.0-py2.py3-none-any.whl