Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Does KNNSearch not support CUDA? #643

Open
3 tasks done
dfldylan opened this issue Mar 12, 2024 · 0 comments
Open
3 tasks done

Does KNNSearch not support CUDA? #643

dfldylan opened this issue Mar 12, 2024 · 0 comments
Labels
question Further information is requested

Comments

@dfldylan
Copy link

dfldylan commented Mar 12, 2024

Checklist

My Question

open3d==0.18, code

import torch
from open3d.ml.torch.layers import KNNSearch

# 假设已经有了数据和查询点,这里使用随机数据作为示例
points = torch.rand(100, 3, dtype=torch.float32).cuda()  # 点云数据,假设已经在 GPU 上
queries = torch.rand(10, 3, dtype=torch.float32).cuda()   # 查询点,假设已经在 GPU 上

# 创建 KNNSearch 层实例
knn_search = KNNSearch()

# 执行 k-NN 搜索
k = 5
neighbors_index, neighbors_distance = knn_search(points, queries=queries, k=k)

# `neighbors_index` 和 `neighbors_distance` 分别是查询点的最近邻索引和距离

result

/root/miniconda3/envs/gaussian_splatting/bin/python /workspace/gaussian/gaussian-splatting/utils/density.py 
Traceback (most recent call last):
  File "/workspace/gaussian/gaussian-splatting/utils/density.py", line 42, in <module>
    neighbors_index, neighbors_distance = knn_search(points=points, queries=queries, k=k)
  File "/root/miniconda3/envs/gaussian_splatting/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/root/miniconda3/envs/gaussian_splatting/lib/python3.7/site-packages/open3d/ml/torch/python/layers/neighbor_search.py", line 382, in forward
    index_dtype=self.index_dtype)
  File "/root/miniconda3/envs/gaussian_splatting/lib/python3.7/site-packages/open3d/ml/torch/python/ops.py", line 642, in knn_search
    return_distances=return_distances))
  File "/root/miniconda3/envs/gaussian_splatting/lib/python3.7/site-packages/torch/_ops.py", line 143, in __call__
    return self._op(*args, **kwargs or {})
RuntimeError: KnnSearch does not support CUDA

Looking forward your answer

@dfldylan dfldylan added the question Further information is requested label Mar 12, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant