Closed a-lemus96 closed 8 months ago
rgb
does not require grad
> /home/lemus/projects/fs-nerf/src/run-nerf.py(241)train()
-> rgb_gt = rgb_gt.to(device)
(Pdb) rgb.requires_grad
False
Problem might be due to extreme cases in which no samples are available from sampling step. In the first iteration, tensors from sampling method are empty as per pdb
> /home/lemus/projects/fs-nerf/src/render/renderer.py(84)render_rays()
-> ray_idxs, t_starts, t_ends = self.estimator.sampling(
(Pdb) n
> /home/lemus/projects/fs-nerf/src/render/renderer.py(94)render_rays()
-> def _rgb_sigma_fn(t_starts, t_ends, ray_idxs):
(Pdb) ray_idxs.shape
torch.Size([0])
(Pdb) t_starts.shape
torch.Size([0])
Removed try-catch statement from render_rays fn
When running python run-nerf.py --debug
using pdb
module I found that model outputted tensors do track gradients
> /home/lemus/projects/fs-nerf/src/run-nerf.py(238)train()
-> raw = model(rays_o)
(Pdb) n
> /home/lemus/projects/fs-nerf/src/run-nerf.py(239)train()
-> render_output = renderer.render_rays(rays_o, rays_d, model)
(Pdb) raw.requires_grad
True
During the first iteration, since the ray_idxs
length is zero as well as for t_starts
and t_ends
, the nerfacc package bypasses _sigma_rgb_fn
call and instead creates two empty tensors that do not track gradients. This can be verified from nerfacc
module base code:
Originally posted by @a-lemus96 in #61