This repo has been archived and replaced with the new tlfm repo in OpenMV firmware. The new tflm
repo includes a compiled copy of the entire tensorflow lite for microcontrollers library with all headers for various targets generated by github actions.
Full featured Tensorflow package for Cortex-M0-Plus, Cortex-M4, Cortex-M7, and Cortex-M55 CPUs with no external dependencies!
-
Clone this repo recursively:
git clone --recursive https://github.com/openmv/tensorflow-lib.git
-
If you already have
arm-none-eabi-gcc
installed and available on your path do:python make.py
-
Otherwise, install GCC (only needs to be done once):
source ci.sh && ci_install_arm_gcc
-
And then do:
source ci.sh ci_build
You will need to use the source ci.sh ci_build
to compile the library if you installed gcc via source ci.sh && ci_install_arm_gcc
and did not add GCC to your path.
If you edit anything in the Edge Impulse SDK (TensorFlow) repo, make sure to do python make.py --clean
afterward to delete any cached changes. Otherwise, you may get confusing errors.
You can find libtf pre-built under releases. Alternatively, you may include this repo as a submodule and use libtf directly from the repo. This will allow you to easily update libtf without having to store the binaries directly in your repo.
Contributions are most welcome. If you are interested in contributing to the project, start by creating a fork of each of the following repositories:
- https://github.com/openmv/tensorflow-lib.git
- https://github.com/openmv/tensorflow.git
Clone the forked tensorflow-lib repository, and add a remote to the main tensorflow-lib repository:
git clone --recursive https://github.com/<username>/tensorflow-lib.git
git -C tensorflow-lib remote add upstream https://github.com/openmv/tensorflow-lib.git
Set the origin
remote of the tensorflow submodule to the forked tensorflow repo:
git -C tensorflow-lib/edge-impulse-sdk remote set-url origin https://github.com/<username>/tensorflow.git
Finally add a remote to openmv's tensorflow fork:
git -C tensorflow-lib/edge-impulse-sdk remote add upstream https://github.com/openmv/tensorflow.git
Now the repositories are ready for pull requests. To send a pull request, create a new feature branch and push it to origin, and use Github to create the pull request from the forked repository to the upstream openmv/micropython repository. For example:
git checkout -b <some_branch_name>
<commit changes>
git push origin -u <some_branch_name>
Please follow the best practices when sending pull requests upstream. In general, the pull request should:
- Fix one problem. Don't try to tackle multiple issues at once.
- Split the changes into logical groups using git commits.
- Pull request title should be less than 78 characters, and match this pattern:
<scope>:<1 space><description><.>
- Commit subject line should be less than 78 characters, and match this pattern:
<scope>:<1 space><description><.>