def _get_summary(self):
# build the self.summ_op for tensorboard
# This function could be overwritten
if not self.flags.visualize or self.flags.visualize=='none':
return
summ_collection = "{} {} {} summaries".format(self.flags.comp, self.flags.sol, self.flags.run_name)
if len(tf.get_collection(tf.GraphKeys.SCALARS)):
self.scaler_op = tf.summary.merge(tf.get_collection(tf.GraphKeys.SCALARS))
if len(tf.get_collection(tf.GraphKeys.IMAGES)):
self.image_op = tf.summary.merge(tf.get_collection(tf.GraphKeys.IMAGES))
for i in tf.get_collection(tf.GraphKeys.SCALARS):
tf.add_to_collection(summ_collection, i)
for i in tf.get_collection(tf.GraphKeys.WEIGHTS):
tf.add_to_collection(summ_collection, i)
for i in tf.get_collection(tf.GraphKeys.FEATURE_MAPS):
tf.add_to_collection(summ_collection, i)
for i in tf.get_collection(tf.GraphKeys.IMAGES):
tf.add_to_collection(summ_collection, i)
for i in tf.get_collection(tf.GraphKeys.GRADIENTS):
tf.add_to_collection(summ_collection, i)
for i in tf.get_collection(tf.GraphKeys.EMBEDDINGS):
tf.add_to_collection(summ_collection, i)
self.summ_op = tf.summary.merge(tf.get_collection(summ_collection))
评论列表
文章目录