Closed a-lemus96 closed 8 months ago
Previous test hardcoded tensor was not deleting, causing device mismatch...
> /home/lemus/projects/fs-nerf/src/utils/utilities.py(71)get_rays()
-> dirs = dirs/torch.norm(dirs, dim=-1, keepdim=True)
(Pdb) dirs.device
device(type='cuda', index=0)
(Pdb) n
> /home/lemus/projects/fs-nerf/src/utils/utilities.py(72)get_rays()
-> dirs = dirs[None, ..., None, :]
(Pdb) n
> /home/lemus/projects/fs-nerf/src/utils/utilities.py(74)get_rays()
-> poses = torch.rand(5, 4, 4)
(Pdb) n
> /home/lemus/projects/fs-nerf/src/utils/utilities.py(75)get_rays()
-> poses = poses.unsqueeze(-3) if poses.dim() == 2 else poses
(Pdb) n
> /home/lemus/projects/fs-nerf/src/utils/utilities.py(76)get_rays()
-> poses = poses[..., None, None, :3, :3]
(Pdb) n
> /home/lemus/projects/fs-nerf/src/utils/utilities.py(77)get_rays()
-> dirs_w = torch.sum(dirs * poses, axis=-1)
(Pdb) poses.device
device(type='cpu')
Poses are not being passed as tensors to get_rays function.
(Pdb) type(poses)
<class 'list'>
Poses are not being passed as tensors to get_rays function.
(Pdb) type(poses) <class 'list'>
In fact, poses
is a list containing two tensors: images and poses
(Pdb) poses[0].shape
torch.Size([50, 800, 800, 3])
(Pdb) poses[1].shape
torch.Size([50, 4, 4])
I removed device dependency in get_rays
fn.
Originally posted by @a-lemus96 in #61