Skip to content

Commit

Permalink
finally block
Browse files Browse the repository at this point in the history
  • Loading branch information
kerrj committed Oct 18, 2024
1 parent 5dae507 commit b32e793
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nerfstudio/viewer/render_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ def _render_img(self, camera_state: CameraState):
with torch.no_grad(), viewer_utils.SetTrace(self.check_interrupt):
outputs = self.viewer.get_model().get_outputs_for_camera(camera, obb_box=obb)
except viewer_utils.IOChangeException:
raise
finally:
if was_training:
self.viewer.get_model().train()
raise
if was_training:
self.viewer.get_model().train()
num_rays = (camera.height * camera.width).item()
if self.viewer.control_panel.layer_depth:
if isinstance(self.viewer.get_model(), SplatfactoModel):
Expand Down

0 comments on commit b32e793

Please sign in to comment.