被 Tensorboard 折磨 ing, 碰到这个问题,不得其解。 首先我用 placeholder 定义了一个计算图,并将其中的某些变量添加到了 tf.summary.scalar()中。 随后我以如下方式添加了 tf.summary.merge_all()
# Graph has been defined above
# And variables have beed added via tf.summary.scalar()
init = tf.global_variables_initializer()
if save_dir is not None:
merged_summary_op = tf.summary.merge_all()
# Training process...
with tf.Session() as sess:
sess.run(init)
print(tf.get_collection(tf.GraphKeys.SUMMARIES), merged_summary_op)
# returns [] None
报错显示为:
cost, rcost, merged = sess.run([self.cost, self.rcost, merged_summary_op], feed_dict={self.mode:'train', self.x:data, self.labels:label})
TypeError: Fetch argument None has invalid type <class 'NoneType'> ( merged_summary_op -> None )
请问这是什么原因导致的?
我查到了一篇博客,里面描述了一种情形,我也不太理解。这会是跟我类似的问题吗?
博客链接