RuntimeError: invalid argument 5: k not in range for dimension at C:/w/b/windows/pytorch/aten/src\THC/generic/THCTensorTopK.cu:24
在调用DGCNN函数时
knn出现报错
def knn(x, k):
inner = -2 * torch.matmul(x.transpose(2, 1).contiguous(), x)
xx = torch.sum(x ** 2, dim=1, keepdim=True)
distance = -xx - inner - xx.transpose(2, 1).contiguous()
idx = distance.topk( k=k, dim=-1)[1] # 此处出现报错
return idx
尝试解决但都没有效果,求问解决方法