guochengqian/PointNeXt

PointNeXt on CPU

Opened this issue · 1 comments

Hi,

Thank you for the great model! I have been trying to use PointNeXt on CPU, but I keep getting errors.

First I sent my model to cpu, then the dataset to cpu. Then I get the error below. This seems to be caused by the idx variable still being on cuda, since it was generated using the pointnet2_cuda function. I am not able to do anything with this variable, such as printing or sending to another device. FYI I am using Windows.

Traceback (most recent call last): File "examples/segmentation/main.py", line 845, in <module> irradiance = evaluate_file(model_path, data_path, cfg) File "C:\Users\Job de Vogel\.conda\envs\openpoints37\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context return func(*args, **kwargs) File "examples/segmentation/main.py", line 677, in evaluate_file irradiance = model(data).cpu().numpy()[0, 0, :] File "C:\Users\Job de Vogel\.conda\envs\openpoints37\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Job de Vogel\OneDrive\Documenten\TU Delft\Master Thesis\Code\IrradianceNet\PointNeXt\examples\segmentation\../..\openpoints\models\segmentation\base_seg.py", line 46, in forward p, f = self.encoder.forward_seg_feat(data) File "C:\Users\Job de Vogel\OneDrive\Documenten\TU Delft\Master Thesis\Code\IrradianceNet\PointNeXt\examples\segmentation\../..\openpoints\models\backbone\pointnext.py", line 461, in forward_seg_feat _p, _f = self.encoder[i]([p[-1], f[-1]]) File "C:\Users\Job de Vogel\.conda\envs\openpoints37\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Job de Vogel\.conda\envs\openpoints37\lib\site-packages\torch\nn\modules\container.py", line 141, in forward input = module(input) File "C:\Users\Job de Vogel\.conda\envs\openpoints37\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl return forward_call(*input, **kwargs) File "C:\Users\Job de Vogel\OneDrive\Documenten\TU Delft\Master Thesis\Code\IrradianceNet\PointNeXt\examples\segmentation\../..\openpoints\models\backbone\pointnext.py", line 149, in forward new_p = torch.gather(p, 1, idx.unsqueeze(-1).expand(-1, -1, 3)) RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper_gather)

Error after printing the ìdx variable:
RuntimeError: CUDA error: an illegal memory access was encountered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.

Hi, thank you for your post, I am trying to do the same thing as you did. Just a quick question, where in the code have you changed to switch the GPU off and change it to CPU?