Tflite-micro Error : No rule generate_projects

Hi !

We have built 5 models using TensorFlow version 2.14.0 and converted them to .tflite. They are to be deployed on hardware Texas Instruments CP1352P7 ARM Cortex M4F multiprotocol.

We are using the tflite-micro library hosted in the git repository to build the executable and include dependencies. However, while trying to do so with the following command:

make - f tensorflow/lite/micro/tools/make/Makefile generate_projects

However, we are getting the following error :

tensorflow/lite/micro/tools/make/downloads/flatbuffers already exists, skipping the download.
tensorflow/lite/micro/tools/make/downloads/kissfft already exists, skipping the download.
tensorflow/lite/micro/tools/make/downloads/pigweed already exists, skipping the download.
make: *** No rule to make target ‘generate_projects’. Stop.

This indicates the generate_projects rule does not exist in the Makefile. On checking manually, we cant find the rule in the Makefile either. tflite-micro does not seem to have any versioning to indicate whether and by what has this rule changed i.e. is there another name for this in later versions?

Another question I have is that, though I see in the Makefile that it seems to be able to figure out the host architecture i.e. TI CC1352P7…but Im wondering if this happens in the hardware itself i.e. if I am running this in the command line on my computer - how does it know I will be installing this in the CC1352P7 hardware. Im sure there must be some parameters related to this. I have no background in hardware and/or C++. Purely a Data Scientist using Python. My assumption is that it should be neccessary while giving the make command to also specify target and architecture (as mentioned in the Makefile comments itself that this is possible).

Any help will be highly appreciated.

Regards
Rikki S

Hi Rikki,

I attempted to follow these same instructions and ran into the same issue as you. I believe these instructions may be outdated. I’m not sure if setting up the Python venv is necessary, but I followed instructions in two different .md files to build for the nRF52840, which is also a Cortex M4.

  • docs/python.md: In this I went through the “Manual Setup Illustration” to get a Python environment properly set up.
  • After that, tensorflow/lite/micro/cortex_m_generic/README.md has instructions on how to build for specific Cortex-M architectures.

I used make -f tensorflow/lite/micro/tools/make/Makefile TARGET=cortex_m_generic TARGET_ARCH=cortex-m4 OPTIMIZED_KERNEL_DIR=cmsis_nn microlite to build the static library. If you do not specify a toolchain, it will use Arm gcc and will download the toolchain before building. This gets downloaded to tensorflow/lite/micro/tools/make/downloads/gcc_embedded. In my case, it downloaded v13.2.rel1.

[CMSIS NN}(CMSIS: Introduction) is an optimized kernel specifically for running TensorFlow Lite on Cortex M architecture.

The final .a output ends up in gen/cortex_m_generic_cortex-m4_default/lib/libtensorflow-microlite.a.

On my journey of figuring out how to build this, I ended up installing Bazel and the mbed command line tools. I do not believe either of those are necessry.

Best of luck,
Aaron F