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

TFLite micro hello_world sketch fails to build #34748

Closed
proppy opened this issue Dec 2, 2019 · 4 comments
Closed

TFLite micro hello_world sketch fails to build #34748

proppy opened this issue Dec 2, 2019 · 4 comments
Assignees

Comments

@proppy
Copy link
Contributor

proppy commented Dec 2, 2019

System information

  • OS Platform and Distribution: 4.19.67-2rodete2-amd64
  • Target platform: Arduino 1.8.10 w/ nano33ble target
  • TensorFlow version: 1.15.0-ALPHA

Describe the problem

hello_world sketches fails to build due to a missing header file (not included in the Arduino libraries distribution).

Provide the exact sequence of commands / steps that you executed before running into the problem

  • Install Arduino_TensorFlowLite@1.15.0-ALPHA
  • Open hello_world example sketch
  • Click the Verify ✓ button.

Any other info / logs

/usr/local/google/home/proppy/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -c -w -g -Os -nostdlib @/usr/local/google/home/proppy/.arduino15/packages/arduino/hardware/mbed/1.1.3/variants/ARDUINO_NANO33BLE/defines.txt @/usr/local/google/home/proppy/.arduino15/packages/arduino/hardware/mbed/1.1.3/variants/ARDUINO_NANO33BLE/cxxflags.txt -DARDUINO_ARCH_NRF52840 -mcpu=cortex-m4 -w -x c++ -E -CC -DARDUINO=10810 -DARDUINO_ARDUINO_NANO33BLE -DARDUINO_ARCH_MBED -I/usr/local/google/home/proppy/.arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino -I/usr/local/google/home/proppy/.arduino15/packages/arduino/hardware/mbed/1.1.3/variants/ARDUINO_NANO33BLE -I/usr/local/google/home/proppy/Arduino/libraries/Arduino_TensorFlowLite/src -I/usr/local/google/home/proppy/.arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino/api/deprecated -iprefix/usr/local/google/home/proppy/.arduino15/packages/arduino/hardware/mbed/1.1.3/cores/arduino @/usr/local/google/home/proppy/.arduino15/packages/arduino/hardware/mbed/1.1.3/variants/ARDUINO_NANO33BLE/includes.txt /tmp/arduino_build_987011/sketch/hello_world.ino.cpp -o /dev/null
Alternatives for tensorflow/lite/c/common.h: []
ResolveLibrary(tensorflow/lite/c/common.h)
  -> candidates: []
Multiple libraries were found for "TensorFlowLite.h"
In file included from /tmp/arduino_modified_sketch_134477/hello_world.ino:21:0:
 Used: /usr/local/google/home/proppy/Arduino/libraries/Arduino_TensorFlowLite
output_handler.h:19:10: error: tensorflow/lite/c/common.h: No such file or directory
 Not used: /usr/local/google/home/proppy/Arduino/libraries/tensorflow_lite
 #include "tensorflow/lite/c/common.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

/cc @dansitu @khanhlvg

@proppy
Copy link
Contributor Author

proppy commented Dec 2, 2019

Simply removing the following include workaround the issue.

#include "tensorflow/lite/c/common.h"

@nutsiepully
Copy link
Contributor

@advaitjain - Assigning since you're reviewing #34747

@advaitjain
Copy link
Member

This works for me from the tip of tree. I think @proppy is running into a mismatch between the example and library version.

Can you try manually generating the latest tensorflow_lite arduino library with these steps:

make -f tensorflow/lite/experimental/micro/tools/make/Makefile clean
make -f tensorflow/lite/experimental/micro/tools/make/Makefile \
  TARGET=arduino \
  TAGS="portable_optimized" \
  generate_arduino_zip

Remove the existing tensorflow_lite library (you can also move it if you prefer that):

rm -rf ~/Arduino/libraries/tensorflow_lite

Install the newly created Arduino library:

unzip tensorflow/lite/experimental/micro/tools/make/gen/arduino_x86_64/prj/tensorflow_lite.zip -d ~/Arduino/libraries/

And then try the build.

These steps worked for me so I'm assuming that it is only some configuration issue at your end.

Adding @petewarden and @dansitu to this conversation.

@proppy
Copy link
Contributor Author

proppy commented Dec 3, 2019

@advaitjain Spot on!

I thought this was happening against a new installation of Arduino 1.8.10 against the latest published version of the library 1.15.0-ALPHA. But after testing against a fresh install of the library after cleaning up ~/Arduino/libraries, the hello_world example compile successfully.

I think this was due to example being picked up from a stale installation in tensorflow_lite (as shown in the compile log) while include files where being looked up in another directory Arduino_TensorFlowLite.

Sorry for the noise!

@proppy proppy closed this as completed Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants