1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-17 19:20:19 +01:00

fix for tensorboard visualization slowing execution even when it is off

apparently tensorflow still collect summary data even when no summary FileWriter is defined.
This commit is contained in:
Gal Leibovich
2018-02-17 12:42:59 +02:00
parent 72d34f4063
commit 16c5032735

View File

@@ -90,7 +90,8 @@ class TensorFlowArchitecture(Architecture):
for idx, var in enumerate(self.trainable_weights): for idx, var in enumerate(self.trainable_weights):
placeholder = tf.placeholder(tf.float32, shape=var.get_shape(), name=str(idx) + '_holder') placeholder = tf.placeholder(tf.float32, shape=var.get_shape(), name=str(idx) + '_holder')
self.weights_placeholders.append(placeholder) self.weights_placeholders.append(placeholder)
variable_summaries(var) if self.tp.visualization.tensorboard:
variable_summaries(var)
self.update_weights_from_list = [weights.assign(holder) for holder, weights in self.update_weights_from_list = [weights.assign(holder) for holder, weights in
zip(self.weights_placeholders, self.trainable_weights)] zip(self.weights_placeholders, self.trainable_weights)]