MAKE doesn't work on hello_world_test from TinyML book

Hi,

I’ve got Git and make 4.3 on my laptop which I downloaded through chocolatey. I’m using windows 10.
I managed to clone the Tensorflow source code and all the files seem to be fine but when I tried to use the code "make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test " (from page 84 in the TinyML book) I get the following message:

C:\Users\zalan\tensorflow>make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test
process_begin: CreateProcess(NULL, uname -m, …) failed.
tensorflow/lite/micro/tools/make/Makefile:32: pipe: No error
-m was unexpected at this time.
FIND: Parameter format not correct
make: *** No rule to make target ‘test_hello_world_test’. Stop.

I couldn’t figure out a way to fix it and saw someone else using Ubuntu to get it work, so I donwloaded it and tried it but it didn’t work either. I got the following message:

zal_n@LAPTOP-74R8EDS8:/mnt/c/users/zalan/tensorflow$ make -f tensorflow/lite/micro/tools/make/Makefile test_hello_world_test
tensorflow/lite/micro/tools/make/Makefile:306: warning: overriding recipe for target ‘tensorflow/lite/micro/tools/make/downloads/ruy’
tensorflow/lite/micro/tools/make/Makefile:306: warning: ignoring old recipe for target ‘tensorflow/lite/micro/tools/make/downloads/ruy’
tensorflow/lite/micro/tools/make/Makefile:306: warning: overriding recipe for target ‘tensorflow/lite/micro/tools/make/downloads/person_model_grayscale’
tensorflow/lite/micro/tools/make/Makefile:306: warning: ignoring old recipe for target ‘tensorflow/lite/micro/tools/make/downloads/person_model_grayscale’
tensorflow/lite/micro/tools/make/Makefile:306: warning: overriding recipe for target ‘tensorflow/lite/micro/tools/make/downloads/person_model_int8’
tensorflow/lite/micro/tools/make/Makefile:306: warning: ignoring old recipe for target ‘tensorflow/lite/micro/tools/make/downloads/person_model_int8’
tensorflow/lite/micro/tools/make/download_and_extract.sh “https://github.com/google/gemmlowp/archive/719139ce755a0f31cbf1c37f7f98adcc7fc9f425.zip” “7e8191b24853d75de2af87622ad293ba” tensorflow/lite/micro/tools/make/downloads/gemmlowp
tensorflow/lite/micro/tools/make/download_and_extract.sh: line 16: '\r': command not found tensorflow/lite/micro/tools/make/download_and_extract.sh: line 24: ‘\r’: command not found
: invalid optionmicro/tools/make/download_and_extract.sh: line 25: set: -
set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [–] [arg …]
tensorflow/lite/micro/tools/make/download_and_extract.sh: line 26: '\r': command not found tensorflow/lite/micro/tools/make/download_and_extract.sh: line 28: syntax error near unexpected token `‘{\r’’
'ensorflow/lite/micro/tools/make/download_and_extract.sh: line 28: `patch_am_sdk() {
make: *** [tensorflow/lite/micro/tools/make/Makefile:306: tensorflow/lite/micro/tools/make/downloads/gemmlowp] Error 2

So, I’m clueless at this point, I’d appreciate any help.

Hi @zal_N!

I don’t think the TensorFlow Lite for Microcontrollers library officially supports Windows yet, so trying with Ubuntu is a good idea. Are you using a recent version of bash and make? I’d try and confirm that these are up to date in case they are the source of your problem.

Otherwise, if this appears to be an issue with the TensorFlow Lite for Microcontrollers library, I’d recommend filing a bug with the TensorFlow team at this URL:

Sorry to hear you’re having these issues!

Warmly,
Dan

Hi Dan,

Thanks for your reply and the link. I checked the versions of bash and make and they seem to be up to date. I’ll file a bug to the TF team and hopefully they’ll manage to sort out the problem. I’ll update this post if the problem is solved.
Thanks.

Zalan

Thank you for the update, and I’m sorry you are having this issue!

Hi Dan,
With the help of the TensorFlow team I managed to get the issue solved. They suggested to check out this forum where I found the solution:

Basically, the problem was I tried to run ‘make’ on a file that was not in the WSL directory but under Windows and that’s what caused the problem.
I had to installed git inside of Ubuntu WSL and cloned the TensorFlow files into its system.
I had to install the unzip package too (sudo apt-get install zip unzip) as it wasn’t able to unzip something and I kept getting errors. I followed the suggestions from this website:

And after that I managed to run the tests with ‘make’ and they all passed:

tensorflow/lite/micro/testing/test_linux_binary.sh tensorflow/lite/micro/tools/make/gen/linux_x86_64/bin/hello_world_test ‘~ALL TESTS PASSED~’

As a side note: When I first ran the ‘make’ command after sorting out git and unzip packages, I ran into a problem. I created a directory called tensorflow in my Ubuntu home directory and first I cloned tensorflow.git inside that. And when I ran ‘make’ I got this error message:

In file included from ./tensorflow/lite/kernels/internal/reference/conv.h:19,
from tensorflow/lite/micro/kernels/conv.cc:16:
./tensorflow/lite/kernels/internal/common.h:26:10: fatal error: fixedpoint/fixedpoint.h: No such file or directory
26 | #include “fixedpoint/fixedpoint.h”
| ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [tensorflow/lite/micro/tools/make/Makefile:325: tensorflow/lite/micro/tools/make/gen/linux_x86_64/obj/tensorflow/lite/micro/kernels/conv.o] Error 1

Later I figured out that the problem occurred as I had a tesnorflow directory in another tensorflow directory (tensorflow/tensorflow…) which must have confused ‘make’ while running the tests. So, I deleted all the files and cloned tensorflow.git directly under my home directory and that solved the issue. So, hopefully if someone else runs into the same issue this will help.
Thanks for your help!