Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Viewer Recursion: StackOverflow in Server Setup #1987

Merged
merged 1 commit into from
May 24, 2023

Conversation

lukasHoel
Copy link
Contributor

This PR fixes the following bug:

Describe the bug

  1. ViewerState is initialized in the trainer:

    self.viewer_state = ViewerState(

  2. This eventually makes a call to parse_objects to construct the model tree:

  3. If part of the model contains an infinite recursion (e.g. a torch.nn.Module that links back to its parent for completely valid implementation reasons), then parse_objects will result in a StackOverflow since recursion is repeated indefinitely.

To Reproduce
Steps to reproduce the behavior:

  1. Create a custom pipeline
  2. The custom pipeline should have a torch.nn.Module with such a recursion. In my case I use torchmetrics.ClipScore, but any module with that attribute works.
  3. Use the custom pipeline normally in ns-train

Expected behavior
The recursion should stop..

Copy link
Contributor

@tancik tancik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing.

@tancik tancik merged commit eaa4f91 into nerfstudio-project:main May 24, 2023
4 checks passed
@lukasHoel lukasHoel deleted the fix-viewer-recursion branch May 24, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants