【发布时间】:2017-03-22 13:28:28
【问题描述】:
我想学习使用lldb调试的tensorflow的C++源代码如下。
在一个终端中:
>>>import tensorflow as tf
>>>import os
>>>os.getpid()
42677
在另一个终端:
$lldb -p 42677
Process 42677 stopped
* thread #1: tid = 0x9f6c6e, 0x00007fff8fe37f4e libsystem_kernel.dylib`__select + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff8fe37f4e libsystem_kernel.dylib`__select + 10
libsystem_kernel.dylib`__select:
-> 0x7fff8fe37f4e <+10>: jae 0x7fff8fe37f58 ; <+20>
0x7fff8fe37f50 <+12>: movq %rax, %rdi
0x7fff8fe37f53 <+15>: jmp 0x7fff8fe30d94 ; cerror
0x7fff8fe37f58 <+20>: retq
Executable module set to "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python".
Architecture set to: x86_64h-apple-macosx.
(lldb) breakpoint set --name TF_NewSession
Breakpoint 1: where = _pywrap_tensorflow.so`::TF_NewSession(TF_Graph *, const TF_SessionOptions *, TF_Status *) + 31 at c_api.cc:1701, address = 0x000000010ae44ddf
(lldb) continue
Process 42677 resuming
回到第一个终端:
>>>sess = tf.Session()
这应该会按预期触发 lldb 断点“TF_NewSession”。但是无论我尝试了多少次,它都从未触发过。我的 TensorFlow 版本是官方 1.0.1。 谁能帮我解决这个问题?非常感谢!
【问题讨论】:
标签: c++ tensorflow lldb