2

I am trying to use edgetpu USB accelerator with Intel ATOM single board computer and C++ API for real-time inference.

C++ API for edgetpu is based on TensorFlow lite C++ API. I need to include header files from tensorflow/lite directory (e.g. tensorflow/lite/interpreter.h).

My question is can I build tensorflow only with Lite (not other operations used for training )? if yes, how can I do it?

Because installing everything will take long time.

2 Answers2

2

Assuming that you are using a Linux-based system, the following instruction should work:

  • Clone the repository, then checkout to the stable release (currently r1.14):

    git clone https://github.com/tensorflow/tensorflow
    git checkout r1.14
    cd tensorflow
    
  • Download dependencies:

    ./tensorflow/lite/tools/make/download_dependencies.sh
    
  • Build it (by default it builds a Linux library, there are other options as well for other platforms):

    make -f ./tensorflow/lite/tools/make/Makefile
    
  • Now, you'll need to link the built library in your project, add this to your makefile:

    TENSORFLOW_PATH = path/to/tensorflow/
    TFLITE_MAKE_PATH = $(TENSORFLOW_PATH)/tensorflow/lite/tools/make
    CLAGS += \
        -L$(TFLITE_MAKE_PATH)/gen/linux_x86_64/obj \
        -L$(TFLITE_MAKE_PATH)/gen/linux_x86_64/lib/ \
        -ltensorflow-lite -ldl
    
Chan Kha Vu
  • 9,834
  • 6
  • 32
  • 64
1

What you need a standalone build that is out of tensorflow repo. I have tensorflow lite project that may help you, you need to cross compile it for respective platform type.

Milind Deore
  • 2,887
  • 5
  • 25
  • 40