HI all,
I’m working on a nerf-like project and trying manage the experiment results on wandb synced with tensorboard. What I have coded is logging several loss values at every training step, and predicting image later as shown below:
project = "test_sync_tb"
group = "test_group"
job_type = "test_job_type"
run_name = "test_run"
logdir = f"_results/{project}/{group}/{job_type}"
wandb.tensorboard.patch(root_logdir=logdir, pytorch=True)
os.makedirs(logdir, exist_ok=True)
wandb.init(
dir=logdir,
project=project,
group=group,
job_type=job_type,
sync_tensorboard=True
)
writer = torch.utils.tensorboard.SummaryWriter(logdir)
num_training_steps = 10
for i in range(num_training_steps):
for j in range(3):
writer.add_scalar(f"test_training/loss_{j}", i / (j + 1), i)
num_images = 5
h = w = 256
for i in range(num_images):
writer.add_image(
"predicted_images", np.random.rand(h, w, 3), i, dataformats="HWC")
writer.close()
wandb.finish()
WandB summarized the results well except for one thing. I expect the indices for the sequence of predicted images should span from 0 to 4 since those values are passed to add_image()
as `global_step. But as shown in the image below, The indices were 9 to 13.
How can I make the indices start from 0 instead of 9?
Thanks in advance!