返回用于从事件文件中读取 Event
协议缓冲区的迭代器。
用法
tf.compat.v1.train.summary_iterator(
path
)
参数
-
path
SummaryWriter
创建的事件文件的路径。
返回
-
产生
Event
协议缓冲区的迭代器
您可以使用此函数读取写入事件文件的事件。它返回一个 Python 迭代器,它产生 Event
协议缓冲区。
示例:打印事件文件的内容。
for e in tf.compat.v1.train.summary_iterator(path to events file):
print(e)
示例:打印选定的汇总值。
# 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.compat.v1.summary.scalar('loss', loss_tensor)`.
for e in tf.compat.v1.train.summary_iterator(path to events file):
for v in e.summary.value:
if v.tag == 'loss':
print(v.simple_value)
示例:不断检查新的汇总值。
summaries = tf.compat.v1.train.summary_iterator(path to events file)
while True:
for e in summaries:
for v in e.summary.value:
if v.tag == 'loss':
print(v.simple_value)
# Wait for a bit before checking the file for any new events
time.sleep(wait time)
有关其属性的更多信息,请参阅 Event 和 Summary 的协议缓冲区定义。
相关用法
- Python tf.compat.v1.train.shuffle_batch用法及代码示例
- Python tf.compat.v1.train.FtrlOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.train.get_or_create_global_step用法及代码示例
- Python tf.compat.v1.train.cosine_decay_restarts用法及代码示例
- Python tf.compat.v1.train.Optimizer用法及代码示例
- Python tf.compat.v1.train.AdagradOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.train.init_from_checkpoint用法及代码示例
- Python tf.compat.v1.train.Checkpoint用法及代码示例
- Python tf.compat.v1.train.Supervisor.managed_session用法及代码示例
- Python tf.compat.v1.train.Checkpoint.restore用法及代码示例
- Python tf.compat.v1.train.global_step用法及代码示例
- Python tf.compat.v1.train.MonitoredSession.run_step_fn用法及代码示例
- Python tf.compat.v1.train.RMSPropOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.train.exponential_decay用法及代码示例
- Python tf.compat.v1.train.natural_exp_decay用法及代码示例
- Python tf.compat.v1.train.MomentumOptimizer用法及代码示例
- Python tf.compat.v1.train.RMSPropOptimizer用法及代码示例
- Python tf.compat.v1.train.get_global_step用法及代码示例
- Python tf.compat.v1.train.GradientDescentOptimizer.compute_gradients用法及代码示例
- Python tf.compat.v1.train.linear_cosine_decay用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.compat.v1.train.summary_iterator。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。