1. 使用tensorboard no scalar data was found。
解决方案link:https://github.com/tensorflow/tensorflow/issues/2353
在使用tf.summary记录验证集的损失时,总是发现no scalar data was found。
with tf.Session(graph=g) as sess: sess.run(tf.global_variables_initializer()) # create FileWrite object that writes the logs file_writer = tf.summary.FileWriter(logdir='logs/3', graph=g) for i in range(5): # fetch the summary from the graph result, summary = sess.run([train_op, merged_summary], feed_dict={some_value: i}) # write the summary to the log file_writer.add_summary(summary=summary, global_step=i) file_writer.flush()
记得在file_writer.add_summary语句之后加一个file_writer.flush()。因为电脑可能会觉得你的数据太便宜了,“Turned out my example ops were too "cheap" to compute, and adding a file_writer.flush()
after adding the summary to the write solved the issue.“