Max*_*Max 6 profiling tensorflow tensorboard
Tensorboard提供运行时统计信息,可以分析内存消耗和计算时间(请参阅文档).然而,在tensorflow v1.2.1中,我的一些操作以虚线和橙色显示为"未使用的子结构",并且根本没有提供任何信息 - 没有设备,也没有内存,也没有计算时间.
随着tensorflow v1.3的更新,这甚至变得更糟.现在一切都是橙色破旧的"未使用的子结构"
我尝试了各种更大的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)
| 归档时间: |
|
| 查看次数: |
2779 次 |
| 最近记录: |