问题
I would like to shift all the step-values of a specific saved tensorboard summary run by a certain amount. For example: The results start at step 1.000.001 and I want the results to show a start at 1 again, shifting all the values by 1.000.000.
How can I best do this?
回答1:
I found the solution myself:
You can just read it in again using a summary_iterator. and then for every event, save the values to a new summary. So in my case, I needed something like this:
summary_writer = tf.summary.FileWriter("someName")
for event in tf.train.summary_iterator("somePath"):
if (event.step > 1000000):
summary = tf.Summary()
shifted_step = event.step - 1000000
for value in event.summary.value:
print(value.tag)
if (value.HasField('simple_value')):
print(value.simple_value)
summary.value.add(tag='{}'.format(value.tag),simple_value=value.simple_value)
summary_writer.add_summary(summary, shifted_step)
summary_writer.flush()
来源:https://stackoverflow.com/questions/54987749/how-to-edit-a-saved-tensorboard-summary