Skip to content

Suggestion: option to limit number of events saved per tag per run #253

@mdfirman

Description

@mdfirman

edit - made a mistake in understanding of how tensorflow worked - updated issue now

Tensorboard only displays a maximum of 10 images per tag per run - see paragraph 2 in this thread. However, the events file will grow linearly with the number of images:

import numpy as np
from tensorboardX import SummaryWriter

for num_iters in [5, 10, 100]:

    writer = SummaryWriter(str(num_iters))

    for idx in range(num_iters):
        x = np.random.rand(100, 100)
        writer.add_image('Image', x, 0)

This code writes 3 events files - one with 5 steps, one 10 steps and the final with 100 steps.

It would be nice if the file with 100 steps was the same size as the one with 10 steps. However, it isn't, instead the filesize is proportional to the number of steps written:

Num events written Filesize Desired filesize
5 140260 140260
10 280860 280860
100 2779338 280860

My feature request is to allow for SummaryWriter to take an additional argument specifying how many unique steps to save (e,g, inf for backwards compatibility):

writer = SummaryWriter(str(num_iters), max_to_save=10)

I had a look through the code but I'm not sure how trivial this would be to implement. Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions