Python 打印张量键错误:'/设备:CPU:0';

Python 打印张量键错误:'/设备:CPU:0';,python,debugging,tensorflow,keyerror,Python,Debugging,Tensorflow,Keyerror,我试图在AWS GPU(p2 xlarge)上的1.7.0版tensorflow中使用tfdbg 当我尝试打印张量或节点信息时,我得到一个关键错误: print_tensor gradients/TopKV2_grad/Gather_1:0 Error occurred during handling of command: print_tensor gradients/TopKV2_grad/Gather_1:0:

我试图在AWS GPU(p2 xlarge)上的1.7.0版tensorflow中使用tfdbg

当我尝试打印张量或节点信息时,我得到一个关键错误:

print_tensor gradients/TopKV2_grad/Gather_1:0

Error occurred during handling of command: print_tensor gradients/TopKV2_grad/Gather_1:0:                                                                   
<class 'KeyError'>: '/device:CPU:0'

Traceback (most recent call last):
  File "/home/usrnm/.local/lib/python3.5/site-packages/tensorflow/python/debug/cli/debugger_cli_common.py", line 666, in dispatch_command
    output = handler(argv, screen_info=screen_info)
  File "/home/usrnm/.local/lib/python3.5/site-packages/tensorflow/python/debug/cli/analyzer_cli.py", line 930, in print_tensor
    watch_keys = self._debug_dump.debug_watch_keys(node_name)
  File "/home/usrnm/.local/lib/python3.5/site-packages/tensorflow/python/debug/lib/debug_data.py", line 1365, in debug_watch_keys
    if node_name not in self._debug_watches[device_name]:
KeyError: '/device:CPU:0'
print\u tensor gradients/TopKV2\u grad/Gather\u 1:0
处理命令时出错:打印张量渐变/TopKV2\u渐变/Gather\u 1:0:
:“/设备:CPU:0”
回溯(最近一次呼叫最后一次):
文件“/home/usrnm/.local/lib/python3.5/site packages/tensorflow/python/debug/cli/debugger\u cli\u common.py”,第666行,在dispatch\u命令中
输出=处理程序(argv,屏幕信息=屏幕信息)
文件“/home/usrnm/.local/lib/python3.5/site-packages/tensorflow/python/debug/cli/analyzer_-cli.py”,第930行,以打印形式显示
watch\u keys=self.\u debug\u dump.debug\u watch\u keys(节点名称)
文件“/home/usrnm/.local/lib/python3.5/site packages/tensorflow/python/debug/lib/debug_data.py”,第1365行,在debug_watch_键中
如果节点名称不在self中。\u debug\u监视[设备名称]:
KeyError:“/设备:CPU:0”
我正在运行一个脚本,在这个脚本中我没有手动分配设备或使用clusterspec,基本上我只是让tf处理设备

我试着检查在回溯中引用的tf代码,但有点超出我的理解范围

tfdbg不开心的原因有什么线索吗

谢谢大家!

编辑#1: 这似乎发生在我

  • 选择“运行”,然后收到一条消息“!!!运行期间出错!!!'
  • 然后键入

    • “lt”然后打印\u tensor tensor名称或
    • “ni-a-d-t操作名”