TensorFlow kernel debugging; missing debugging symbols

I am trying to learn the internals of TensorFlow by going from Python code to model the CIFAR-10 model into my main C ++ code. Using Eclipse + PyDev for step-by-step debugging of python code works fine, but I cannot find how to enter into the TensorFlow core C ++ code. I tried using the Eclipse CDT to create C ++ code in a separate project and attach the debugger to the python process with cifar10_train.py as described here , but the characters never loaded and (obviously) pending breakpoints never hit.

Background and setting:

I work on Ubuntu 14.04 LTS, installed TensorFlow code from sources, as described here , and my CDT project uses a Makefile containing

bazel build -c dbg //tensorflow/cc:tutorials_example_trainer .

+5
source share
1 answer

TensorFlow loads a library called _pywrap_tensorflow.so , which includes its C API (as defined in tensorflow/tensorflow/core/client/tensor_c_api.cc ).

In my case, the library loaded at runtime was located in
~/tensorflow/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
but the library, which was built from the local source code, was in ~/.cache/bazel/_bazel_<username>/dbb3c677efbf9967e464a5c6a1e69337/tensorflow/bazel-out/local_linux-dbg/bin/tensorflow/python/_pywrap_tensorflow.so .

Copying a locally built library on top of the loaded library and joining the python process, as defined in the task, solve the problem.

+5
source

Source: https://habr.com/ru/post/1236092/


All Articles