Tensorboard - 分析计算时间 - 一切都是运行时统计信息中的"未使用的子结构"

Max*_*Max 6 profiling tensorflow tensorboard

Tensorboard提供运行时统计信息,可以分析内存消耗和计算时间(请参阅文档).然而,在tensorflow v1.2.1中,我的一些操作以虚线和橙色显示为"未使用的子结构",并且根本没有提供任何信息 - 没有设备,也没有内存,也没有计算时间.

随着tensorflow v1.3的更新,这甚至变得更糟.现在一切都是橙色破旧的"未使用的子结构"tensorboard  - 缺少统计数据,未使用的子结构

我尝试了各种更大的tensorflow项目,我需要优化它以及工作的同事PC.我做错了什么,或者这是张量流/张量板中的错误?

这是一个简约的示例代码:

import tensorflow as tf
from tensorflow.python.client import timeline

sess = tf.InteractiveSession() 
run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
run_metadata = tf.RunMetadata()

# create some dummy Ops for the graph
C1 = tf.constant(5)
C2 = tf.constant(3)
myOp = C1*C2 + tf.square(C2)
res = sess.run([myOp], options=run_options,run_metadata = run_metadata)
writer = tf.summary.FileWriter(logdir='tensorboard/profile_bug',graph=sess.graph)
print (res)

tl = timeline.Timeline(run_metadata.step_stats)
ctf = tl.generate_chrome_trace_format()
with open('tensorboard/timelineOfBug.json', 'w') as f:
    f.write(ctf)

writer.add_run_metadata(run_metadata,"mySess")
writer.close()
sess.close()
Run Code Online (Sandbox Code Playgroud)

Tok*_*rby 0

这是一些新版本 TF 的问题(好像是 1.2 和 1.3)。更新到1.4修复了这个问题。