nerfstudio-project / nerfstudio

A collaboration friendly studio for NeRFs
https://docs.nerf.studio
Apache License 2.0
8.87k stars 1.18k forks source link

Small fix when evaluating splatfacto model, running ns-eval #3219

Closed ajean757 closed 2 weeks ago

ajean757 commented 2 weeks ago

In the _get_background_color() function in splatfacto.py, self.background_color is allocated on the cpu, when calling get_outputs(), we get a runtime error "RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!". Added a .to(self.device) to ensure this doesn't happen

ichsan2895 commented 2 weeks ago

This PR fixes my problem in Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

KevinXu02 commented 2 weeks ago

Thanks for catching this!