nerfstudio-project / nerfacc

A General NeRF Acceleration Toolbox in PyTorch.
https://www.nerfacc.com/
Other
1.37k stars 113 forks source link

_C.traverse_grids returns empty intervals, empty samples #222

Open SumanyuAsthana opened 1 year ago

SumanyuAsthana commented 1 year ago

I am using an OccGridEstimator instance as my estimator and following the documentation I .update_every_n_steps the estimator for every iteration, defined a sigma_fn and rgb_sigma_fn , and used estimator.sampling in order to get ray_indices, t_starts, t_ends. But my code doesn't work saying "RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn" and when I traced the issue I found that ray_indices, t_starts, t_ends are empty and further going back in nerfacc/grid.py _C.traverse_grid is being called which is what's returning the empty tensors. How do I proceed? Any help is appreciated. Thanks.

liruilong940607 commented 1 year ago

Hi I’m this case you can check following things:

zhaoliangzhang commented 10 months ago

Hi, I have met the same issue.

May I ask if there are other possible reason of the empty sampling result erro?

destroy314 commented 7 months ago

Hi, I have met the same issue.

  • I firstly check the rays and aabb, it seems that the coordinates of the rays are always lies in the box
  • I checked the density function of my network, the output is non-zero
  • I checked the estimator.binaries.sum() after updating the occ grid, the result is non-zero

May I ask if there are other possible reason of the empty sampling result erro?

I encountered a similar situation, but upon inspection I found that this was because the sampled rays, which corresponded to the first few rows of pixels in the image, did not contain any objects at beginning. This is reasonable for object centric datasets like nerf_synthetic.