tensorboard 在程序中出现的错误:
1.InvalidArgumentError: Shape [-1,2352] has negative dimensions
2.FailedPreconditionError: Attempting to use uninitialized value local3/weight
错误代码段1:
#合并 summary
summary_op = tf.summary.merge_all()
sess = tf.Session()
train_writer = tf.summary.FileWriter(logs_train_dir, sess.graph)
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
..........省略...........
summary_str = sess.run(summary_op)
train_writer.add_summary(summary_str, iteration)
出现错误1:InvalidArgumentError: Shape [-1,2352] has negative dimensions
错误代码段2:
# 合并 summary
summary_op = tf.summary.merge_all()
sess = tf.Session()
# 保存summary
train_writer = tf.summary.FileWriter(logs_train_dir, sess.graph)
sess.run(tf.global_variables_initializer