-
Notifications
You must be signed in to change notification settings - Fork 75.2k
Description
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04 x86 64 bit
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- TensorFlow installed from (source or binary): docker image devel-gpu-py3
- TensorFlow version (use command below):
- Python version: 3.6
- Bazel version (if compiling from source): 0.26.1
- GCC/Compiler version (if compiling from source): 7.4.0
- CUDA/cuDNN version:
- GPU model and memory:
Describe the current behavior
Goal is to build TF Lite with the extended runtime to support non-tf-ops. For this I followed the steps from the official guide (https://www.tensorflow.org/lite/guide/ops_select#c). I added the missing flex delegate dependencies to /tensorflow_src/tensorflow/lite/BUILD:
tflite_cc_shared_object(
name = "libtensorflowlite.so",
linkopts = select({
"//tensorflow:macos": [
"-Wl,-exported_symbols_list,$(location //tensorflow/lite:tflite_exported_symbols.lds)",
"-Wl,-install_name,@rpath/libtensorflowlite.so",
],
"//tensorflow:windows": [],
"//conditions:default": [
"-z defs",
"-Wl,--version-script,$(location //tensorflow/lite:tflite_version_script.lds)",
],
}),
deps = [
":framework",
":tflite_exported_symbols.lds",
":tflite_version_script.lds",
"//tensorflow/lite/kernels:builtin_ops",
"//tensorflow/lite/delegates/flex:delegate",
],
)
I ran the configure script with defaults only and the bazel build command with the mentioned options:
bazel build --config=monolithic --define=with_select_tf_ops=true -c opt //tensorflow/lite:libtensorflowlite.so
This builds without errors. When building my C++ app, it also compiles without errors. But when executing the binary, I get an error:
./myapp: error while loading shared libraries: libtensorflowlite.so: cannot open shared object file: No such file or directory
This is not a path problem because it lies in the same directory as my other .so files. The app works when using the static library generated by the shell scripts in the same directory.
Describe the expected behavior
The app should run just fine with the paths specified.
Other info / logs
.tf_configure.bazel_rc
build --action_env PYTHON_BIN_PATH="/usr/local/bin/python"
build --action_env PYTHON_LIB_PATH="/usr/local/lib/python3.6/dist-packages"
build --python_path="/usr/local/bin/python"
build:xla --define with_xla_support=true
build --config=xla
build --config=tensorrt
build --action_env TF_CUDA_VERSION="10.0"
build --action_env TF_CUDNN_VERSION="7"
build --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-10.0"
build --action_env TF_CUDA_COMPUTE_CAPABILITIES="3.5,5.2,6.0,6.1,7.0"
build --action_env LD_LIBRARY_PATH="/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:/usr/local/nvidia/lib:/usr/local/nvidia/lib64"
build --action_env GCC_HOST_COMPILER_PATH="/usr/bin/gcc"
build --config=cuda
build:opt --copt=-march=native
build:opt --copt=-Wno-sign-compare
build:opt --host_copt=-march=native
build:opt --define with_default_optimizations=true
test --flaky_test_attempts=3
test --test_size_filters=small,medium
test --test_tag_filters=-benchmark-test,-no_oss,-oss_serial
test --build_tag_filters=-benchmark-test,-no_oss
test --test_tag_filters=-no_gpu
test --build_tag_filters=-no_gpu
test --test_env=LD_LIBRARY_PATH
build --action_env TF_CONFIGURE_IOS="0"