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

RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) #51

Open
amoghskanda opened this issue Mar 21, 2024 · 0 comments

Comments

@amoghskanda
Copy link

amoghskanda commented Mar 21, 2024

Getting this error when I try to train streetsurf on seg-10061.
Config used : withmask_nolidar.240219.yaml.
preload_on_gpu is false(by default). Cache is getting loaded onto cpu.
Error on Line411(_ret.update({k: v[frame_ind, h, w].to(device)) for k,v in _ret_image_raw.items()}) in dataloader/baseloader.py.

File "/app/neuralsim/dataio/data_loader/image_loader.py", line 258, in getitem
ret = self.sample(scene_id, cam_id, cam_fi)
File "/app/neuralsim/dataio/data_loader/image_loader.py", line 213, in sample
ground_truth = self.scene_loader.get_image_and_gts(scene_id, cam_id, cam_fi, hw[..., 0], hw[..., 1], device=self.device)
File "/app/neuralsim/dataio/data_loader/base_loader.py", line 614, in get_image_and_gts
gt = self.get_image_and_metas(scene_id, cam_id, frame_ind, h, w, device=device)
File "/app/neuralsim/dataio/data_loader/base_loader.py", line 411, in get_image_and_metas
_ret.update({k: v[frame_ind, h, w].to(device) for k,v in _ret_image_raw.items()})
File "/app/neuralsim/dataio/data_loader/base_loader.py", line 411, in
_ret.update({k: v[frame_ind, h, w].to(device) for k,v in _ret_image_raw.items()})
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

I only changed the loss from MonoDepthLoss to MonoSDFLoss, nothing else. Did anybody face this issue? Thanks

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