在Android Studio项目中使用TensorFlow Lite C++ API的问题咨询
Hey everyone,
I'm working on a neural network project where I need to build an Android app with object detection/recognition capabilities using TensorFlow Lite. To ensure my core code has high portability, I've decided to write the key logic in C++—so I'm using TensorFlow Lite's C++ API instead of the Java API or any pre-built wrappers.
I've already modified the tensorflow/contrib/lite/BUILD file and added a cc_binary target to create a TensorFlow shared library. Here's a snippet of what I added:
cc_binary( name = "libtensorflowlite_custom.so", srcs = [...], deps = [...], # Additional Android-specific configuration flags )
But I've hit a few roadblocks during this process and could really use some technical help. The main issues I'm stuck on are:
- Compiling for Android throws linker errors, complaining about missing certain TensorFlow Lite symbols
- The generated shared library fails to load properly on Android devices, triggering an
UnsatisfiedLinkError - I'm unsure if my BUILD file configuration is correctly optimized for the Android platform—especially around dependency management and compiler flags
Has anyone gone through a similar setup? Any tips for fixing these build issues, or best practices for setting up TensorFlow Lite C++ for Android development would be a huge help!
内容的提问来源于stack exchange,提问作者martinharz

