Skip to content

Commit 486064b

Browse files
Update logger.py
adding support for changeable batchsize
1 parent 7c13895 commit 486064b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utils/logger.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def summarize(self, step, summerizer="train", scope="", summaries_dict=None):
2828
summary_list = []
2929
for tag, value in summaries_dict.items():
3030
if tag not in self.summary_ops:
31-
self.summary_placeholders[tag] = tf.placeholder('float32', value.shape, name=tag)
31+
if len(value.shape) <=1:
32+
self.summary_placeholders[tag] = tf.placeholder('float32', value.shape, name=tag)
33+
else :
34+
self.summary_placeholders[tag] = tf.placeholder('float32', [None] + list(value.shape[1:]),name=tag)
3235
if len(value.shape) <= 1:
3336
self.summary_ops[tag] = tf.summary.scalar(tag, self.summary_placeholders[tag])
3437
else:

0 commit comments

Comments
 (0)