tensorboardX icon indicating copy to clipboard operation
tensorboardX copied to clipboard

Add option to reuse FileWriter in add_scalars()

Open gcampax opened this issue 6 years ago • 1 comments

SummaryWriter.add_scalars() will create a new FileWriter for each tag that is added. This is both inefficient (too many open file descriptors, non-consecutive disk writes, too many inotify handles from tensorboard, inefficient network IO from browser to tensorboard) and ugly to look at, because it causes too many runs to show up, different tags get mixed up in the same plot in weird ways, and it breaks the tag hierarchy. There should be an option to base the file name only on the main_tag parameter, or alternatively an an optional keyword parameter (file_prefix ? run_name ?) to override the filewriter selection logic entirely.

gcampax avatar Mar 01 '19 16:03 gcampax

I guess you need add_custom_scalars. It is more general then add_scalars and less cluttered. https://tensorboardx.readthedocs.io/en/latest/tensorboard.html#tensorboardX.SummaryWriter.add_custom_scalars However tensorboard assigns different line color for each run. So although add_custom_scalars only produces one run, the lines in chart will be draw in the same color, which is harder to view.

Btw, how intensive is your IO readwrite?

lanpa avatar Mar 03 '19 17:03 lanpa