From 82b3f70f87833f5a3365049956e0f4105d586fe9 Mon Sep 17 00:00:00 2001 From: machenmusik Date: Mon, 10 Jul 2023 18:09:44 -0400 Subject: [PATCH] Avoid zero duration crash (#2193) Avoid zero duration divide-by-zero crash when processing too quickly. --- nerfstudio/engine/trainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/engine/trainer.py b/nerfstudio/engine/trainer.py index 0ce05db0b..0e194b631 100644 --- a/nerfstudio/engine/trainer.py +++ b/nerfstudio/engine/trainer.py @@ -266,7 +266,7 @@ class Trainer: name=EventName.TRAIN_RAYS_PER_SEC, duration=self.world_size * self.pipeline.datamanager.get_train_rays_per_batch() - / train_t.duration, + / max(0.001, train_t.duration), step=step, avg_over_steps=True, )