Skip to content

Commit

Permalink
Start viewer with more accurate speed calculation (#899)
Browse files Browse the repository at this point in the history
Start viewer with more accurate speed calc
  • Loading branch information
tancik authored Nov 5, 2022
1 parent 93839ca commit 71601f3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions nerfstudio/engine/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,14 @@ def train(self) -> None:
for callback in self.callbacks:
callback.run_callback_at_location(step, location=TrainingCallbackLocation.AFTER_TRAIN_ITERATION)

writer.put_time(
name=EventName.TRAIN_RAYS_PER_SEC,
duration=self.config.pipeline.datamanager.train_num_rays_per_batch / train_t.duration,
step=step,
avg_over_steps=True,
)
# Skip the first two steps to avoid skewed timings that break the viewer rendering speed estimate.
if step > 1:
writer.put_time(
name=EventName.TRAIN_RAYS_PER_SEC,
duration=self.config.pipeline.datamanager.train_num_rays_per_batch / train_t.duration,
step=step,
avg_over_steps=True,
)

self._update_viewer_state(step)

Expand Down

0 comments on commit 71601f3

Please sign in to comment.