pytorch_geometric icon indicating copy to clipboard operation
pytorch_geometric copied to clipboard

knn_graph error , because the scalar of k is too large?

Open WMQ1999 opened this issue 2 years ago • 1 comments

🐛 Describe the bug

I use knn_graph, and the parameter k=2000, then the error appeared:

RuntimeError: k <= 100INTERNAL ASSERT FAILED at "csrc/cuda/knn_cuda.cu":98, please report a bug to PyTorch. `k` needs to smaller than or equal to 100

Environment

  • PyG version: 2.0.4
  • PyTorch version: 1.10
  • OS: windows
  • Python version: 3.9.7
  • CUDA/cuDNN version: 11.1
  • How you installed PyTorch and PyG (conda, pip, source): conda
  • Any other relevant information (e.g., version of torch-scatter):

WMQ1999 avatar May 22 '22 08:05 WMQ1999

Our knn_cuda implementation stores the neighbors for each node/thread in private local memory. As such, there is an upper bound in the number of neighbors.

rusty1s avatar May 23 '22 06:05 rusty1s