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 splatfacto crash in eval when using viewer #3430

Merged

Conversation

aayushg55
Copy link
Contributor

@aayushg55 aayushg55 commented Sep 16, 2024

This addresses the issue in #3253 where splatfacto training could crash during the evaluation step when interacting with the viewer (e.g., with --vis viewer+wandb). The problem occurs because interacting with the viewer renders a new image in _render_img(), where model.eval() is called at the start and model.train() at the end, regardless of the initial model state (see nerfstudio/viewer/render_state_machine.py#L151). If this happens during the actual eval step of the model, it flips the mode to training during evaluation, causing errors.

Changes made:

  • Modified eval_iteration() to use the train_lock, ensuring a consistent model state during evaluation

Testing

  • Verified that splatfacto no longer crashes during evaluation with viewer interactions.

Closes #3253

@jb-ye
Copy link
Collaborator

jb-ye commented Sep 16, 2024

It looks good to me, but I want to have @brentyi to take a second pass on this.

Copy link
Collaborator

@brentyi brentyi left a comment

Choose a reason for hiding this comment

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

Makes sense to me too!

@brentyi brentyi merged commit 516fd7c into nerfstudio-project:main Sep 17, 2024
3 checks passed
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.

Splatfacto fails due to the model being train mode instead of eval mode
3 participants