def _add_loss_summaries(total_loss):
"""Add summaries for losses
Generates loss summaries for visualizing the performance of the network.
Args:
total_loss: Total loss from loss().
"""
losses = tf.get_collection('losses')
# Attach a scalar summary to all individual losses and the total loss; do the
# same for the averaged version of the losses.
for l in losses + [total_loss]:
tf.summary.scalar(l.op.name, l)
评论列表
文章目录