I am trying to get Tensorflow Lite + EdgeTpu running on ARM in C++, but having issues building Tensorflow Lite with the specified commit from the EdgeTpu Docs. (I have Tensorflow Lite working on latest master of Tensorflow).
According to the EdgeTpu docs (https://coral.ai/docs/edgetpu/tflite-cpp), tensorflow lite needs to be built with commit: d855adfc5a0195788bf5f92c3c7352e638aa1109. But while building with these commands:
./tensorflow/lite/tools/make/download_dependencies.sh
./tensorflow/lite/tools/make/build_aarch64_lib.sh
I am getting these error messages:
tensorflow/tensorflow/lite/tools/make/gen/aarch64_armv8-a/lib/libtensorflow-lite.a(densify.o): In function `tflite::ops::builtin::densify::Eval(TfLiteContext*, TfLiteNode*)':
densify.cc:(.text+0x378): undefined reference to `tflite::optimize::sparsity::FormatConverter<signed char>::FormatConverter(std::vector<int, std::allocator<int> > const&, TfLiteSparsity const&)'
densify.cc:(.text+0x384): undefined reference to `tflite::optimize::sparsity::FormatConverter<signed char>::SparseToDense(signed char const*)'
densify.cc:(.text+0x5f0): undefined reference to `tflite::optimize::sparsity::FormatConverter<float>::FormatConverter(std::vector<int, std::allocator<int> > const&, TfLiteSparsity const&)'
densify.cc:(.text+0x5fc): undefined reference to `tflite::optimize::sparsity::FormatConverter<float>::SparseToDense(float const*)'
collect2: error: ld returned 1 exit status
So it does build the lib file, but building the examples fails. And I get the same error when I try to use the lib with my own code. The issues seems to be resolved in the meantime on the tensorflow repo. But I need that specific commit for using the EdgeTpu.
Got an answer over the github issues. Putting it here for future reference.
Turns out the specified commit has a missing file in the MAKEFILE. Apply this patch: https://github.com/google-coral/edgetpu/issues/201 and build is working.