擅长:python、mysql、java
<p>要读取TFEvent,您可以获得一个Python迭代器,该迭代器生成事件协议缓冲区。</p>
<pre><code># This example supposes that the events file contains summaries with a
# summary value tag 'loss'. These could have been added by calling
# `add_summary()`, passing the output of a scalar summary op created with
# with: `tf.scalar_summary(['loss'], loss_tensor)`.
for e in tf.train.summary_iterator(path_to_events_file):
for v in e.summary.value:
if v.tag == 'loss' or v.tag == 'accuracy':
print(v.simple_value)
</code></pre>
<p>更多信息:<a href="https://www.tensorflow.org/versions/r0.11/api_docs/python/train.html#summary_iterator" rel="noreferrer">summary_iterator</a></p>