cvg / nice-slam

[CVPR'22] NICE-SLAM: Neural Implicit Scalable Encoding for SLAM

Home Page:https://pengsongyou.github.io/nice-slam

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError: Invalid device string: 'cuda:-1'

Hnshlr opened this issue · comments

When running the algorithm on the apartment dataset, I come across this issue:

I'm on Mac and therefore have no GPU. I however made sure to set device: "cpu" in the configs/nice_slam.yaml config file. Also made sure to export CUDA_VISIBLE_DEVICES="". Would anyone happen to know why I'm encountering this issue?

nice-slam % python -W ignore run.py configs/Apartment/apartment.yaml
INFO: The output folder is output/Apartment
INFO: The GT, generated and residual depth/color images can be found under output/Apartment/tracking_vis/ and output/Apartment/mapping_vis/
INFO: The mesh can be found under output/Apartment/mesh/
INFO: The checkpoint can be found under output/Apartment/ckpt/

Mapping Frame  0

Process Process-2:
Traceback (most recent call last):
  File "/usr/local/Cellar/python@3.7/3.7.16/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/local/Cellar/python@3.7/3.7.16/Frameworks/Python.framework/Versions/3.7/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/hans/Documents/ETUDES/CRANFIELD/Courses/THESIS/Code/nice-slam/src/NICE_SLAM.py", line 276, in mapping
    self.mapper.run()
  File "/Users/hans/Documents/ETUDES/CRANFIELD/Courses/THESIS/Code/nice-slam/src/Mapper.py", line 606, in run
    gt_c2w, self.keyframe_dict, self.keyframe_list, cur_c2w=cur_c2w)
  File "/Users/hans/Documents/ETUDES/CRANFIELD/Courses/THESIS/Code/nice-slam/src/Mapper.py", line 484, in optimize_map
    gt_depth=None if self.coarse_mapper else batch_gt_depth)
  File "/Users/hans/Documents/ETUDES/CRANFIELD/Courses/THESIS/Code/nice-slam/src/utils/Renderer.py", line 176, in render_batch_ray
    raw = self.eval_points(pointsf, decoders, c, stage, device)
  File "/Users/hans/Documents/ETUDES/CRANFIELD/Courses/THESIS/Code/nice-slam/src/utils/Renderer.py", line 50, in eval_points
    ret = decoders(pi, c_grid=c, stage=stage)
  File "/Users/hans/Documents/ETUDES/CRANFIELD/Courses/THESIS/Code/nice-slam/venv/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/Users/hans/Documents/ETUDES/CRANFIELD/Courses/THESIS/Code/nice-slam/src/conv_onet/models/decoder.py", line 326, in forward
    raw = torch.zeros(middle_occ.shape[0], 4).to(device).float()
RuntimeError: Invalid device string: 'cuda:-1'

Probably has nothing to do with the project, but still couldn't find anything related to this "cuda:-1" issue on the Internet.

Thank you in advance. 🙏😭

Hey Hans,
sorry I am not that familiar with running pytorch on Mac. If you want to run the code, you can try to use a desktop with NVIDIA GPU like 1080ti, TITAN X, 3090. Or you can also check out the visualizer https://github.com/cvg/nice-slam#visualizing-nice-slam-results by downloading provided intermediate results, this should be able to run on Mac.
Best,
Zihan