-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the code in "kdnet.py" may be wrong #9
Comments
How does this fix the failure? When I run the code, it crashes at the mentioned line with: This happens in both train.py (line 38) and test.py (line 36). I cannot even see how this line can ever run? I mean Is the addition really correct here? Or is c maybe in reverse order and we should write c[0..11] instead of c[-1..-11] which makes more sense to me and removes the error. But I'm not sure if this is mathematically correct. Best wishes, |
@matherm I came into the same problem. Did you solve this problem? |
The solution can be found in (#11 (comment)). |
In my opinion, the index selection part in the "KDNet_Batch" in "kdnet.py" may be wrong. The offset addition part of variable "sel" makes that the order in "sel" can not match the real points' order in "x".
The mistake can be fixed by change
"sel = Variable(sel + (torch.arange(0,dim) * 3).repeat(batchsize,1).long()).view(-1,1)"
into
"sel = Variable(sel * dim + torch.arange(0,dim).repeat(batchsize,1).long()).view(-1,1)"
The text was updated successfully, but these errors were encountered: