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

Gradient Shape Mismatch in _RasterizeGaussiansBackward Function #41

Open
SHIBOYA opened this issue Aug 27, 2024 · 1 comment
Open

Gradient Shape Mismatch in _RasterizeGaussiansBackward Function #41

SHIBOYA opened this issue Aug 27, 2024 · 1 comment

Comments

@SHIBOYA
Copy link

SHIBOYA commented Aug 27, 2024

Hi, I encounter an issue with using feature-3dgs on my datasets.

While running the train.py script, I encounter the following error during the backward pass:

RuntimeError: Function _RasterizeGaussiansBackward returned an invalid gradient at index 4 - got [2000, 1, 8] but expected shape compatible with [2000, 1, 256]

It seems that the problem arises from a shape mismatch in the gradients returned by the _RasterizeGaussiansBackward function. I've been inspecting the tensor shape transformations during the forward pass, but I'm unsure how to correct this gradient shape mismatch.

  1. Are there specific considerations or transformations in the _RasterizeGaussiansBackward function that I should be aware of when calculating gradients?
  2. How should I adjust the operations in the forward pass, or what modifications should be made during the backward pass, to ensure the gradient shapes are consistent with the expected output?
  3. Do you have any debugging tips or example code that could help me better understand and resolve this issue?

I look forward to any advice or suggestions.

@SHIBOYA
Copy link
Author

SHIBOYA commented Aug 28, 2024

Following up on my previous issue regarding the gradient shape mismatch error, I want to bring up another issue I've encountered during backpropagation related to the _RasterizeGaussiansBackward function.

Occasionally, I receive a different runtime error during the backward pass:

RuntimeError: Function _RasterizeGaussiansBackward returned an invalid gradient at index 4 - got [2025, 26, 8] but expected shape compatible with [1975, 26, 8]

This suggests that the problem might not be limited to a single shape mismatch but could vary depending on the input or some other factors during training. I’m curious to understand more about how the _RasterizeGaussiansBackward function operates.

Specifically, I have the following questions:

  1. Where is _RasterizeGaussiansBackward implemented in the code? I would like to inspect the function to better understand how it handles different dimensional changes during backpropagation.
  2. How should I approach modifying the function to handle varying dimensions properly? Any guidance on ensuring that the shapes of the gradients match as expected across different scenarios would be highly appreciated.

I’m eager to resolve these issues and would greatly appreciate any insights or suggestions you might have on addressing these dimension-related errors.

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