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

PatchPixelSampler + Masks Bottleneck #3040

Open
JDihlmann opened this issue Apr 3, 2024 · 0 comments
Open

PatchPixelSampler + Masks Bottleneck #3040

JDihlmann opened this issue Apr 3, 2024 · 0 comments

Comments

@JDihlmann
Copy link
Contributor

Describe the bug
Using the patch pixel sampler (patch_size=32) and adding masks results in very slow training increasing training time from minutes (w/o masks) to days (w/ masks). After logging times I could identify that the torch.nn.functional.max_pool2d(tensor, kernel_size=kernel_size, stride=1, padding=(kernel_size - 1) // 2) within the dialate function in nerfstudio/data/utils/pixel_sampling_utils.py taking up to 77sec for one batch.

To Reproduce
Steps to reproduce the behavior:

  1. Find a NeRF scene with images and masks
  2. Set --pipeline.datamanager.patch-size 32
  3. Run w/ and w/o masks to see the difference

Expected behavior
A faster default implementation or the possibility to swap to GPU for fast max_pool2d computation.

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

No branches or pull requests

1 participant