Skip to content

Commit 70ea28e

Browse files
Add loss computation over epochs (instead of a single loss per view)
1 parent 4ecf1e1 commit 70ea28e

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

gsplatInterface/trainer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,8 @@ def train(self):
570570

571571
trainloader_iter = iter(trainloader)
572572

573+
epochLoss = 0.
574+
573575
for substep in range(0, dsize):
574576

575577
step = step + 1
@@ -655,6 +657,7 @@ def train(self):
655657
colors.permute(0, 3, 1, 2), pixels.permute(0, 3, 1, 2), padding="valid"
656658
)
657659
loss = l1loss * (1.0 - cfg.ssim_lambda) + ssimloss * cfg.ssim_lambda
660+
epochLoss += loss.item()
658661

659662
if cfg.depth_loss:
660663
# query depths from depth map
@@ -754,6 +757,9 @@ def train(self):
754757
else:
755758
assert_never(self.cfg.strategy)
756759

760+
if not cfg.use_progress_bar:
761+
logging.info(f"Epoch ({epoch}) Loss: {epochLoss}")
762+
757763
if epoch in [i - 1 for i in cfg.save_epochs] or epoch == cfg.max_epochs - 1:
758764

759765
path = f"{self.ckpt_dir}/ckpt_{epoch}_rank{self.world_rank}.pt"

0 commit comments

Comments
 (0)