Instead of using the "tag" feature, you can use the "run" feature.
To do so, you have to open tensorboard from a directory within which you stored your summaries in distinct sub-directories.
In your example, you could save the summary of the first epoch at the directory "tensorboard_log_dir/epoch_1", and then save the summary of the second epoch at the directory "tensorboard_log_dir/epoch_2", etc.
That way, when using tensorboard --logdir=tensorboard_log_dir, you'll be able to switch from one computational graph to another via the "run" widget.
Here's a reproducible example:
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.tensorboard import SummaryWriter
dummy_input = (torch.zeros(1, 3),)
# Two different architectures (PyTorch)
class oneLinear(nn.Module):
def __init__(self):
super(oneLinear, self).__init__()
self.l1 = nn.Linear(3, 5)
def forward(self, x):
x = self.l1(x)
return x
class twoLinear(nn.Module):
def __init__(self):
super(twoLinear, self).__init__()
self.l1 = nn.Linear(3, 5)
self.l2 = nn.Linear(5, 5)
def forward(self, x):
x = self.l1(x)
x = F.relu(self.l2(x))
return x
# add graph into 2 distinct subdirectories
with SummaryWriter('./tensorboard_log_dir/oneLinear') as w:
w.add_graph(oneLinear(), dummy_input)
with SummaryWriter('./tensorboard_log_dir/twoLinear') as w:
w.add_graph(twoLinear(), dummy_input)