Skip to content
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

error in pointops.interpolation #3

Closed
SidneyRey opened this issue Mar 28, 2024 · 4 comments
Closed

error in pointops.interpolation #3

SidneyRey opened this issue Mar 28, 2024 · 4 comments

Comments

@SidneyRey
Copy link

Thank you for your code!
When running the test script, the program hangs in the decoder module within the pointops.interpolation function. The main issue arises specifically in the knnquery part, where values in the idx variable are abnormal. The error message reads as follows:
11

how to fix it?

@nicehuster
Copy link
Owner

Thank you for your interest in our work. I will check the issue later

@chunibyo-wly
Copy link

same issues, thanks for your work

Thank you for your interest in our work. I will check the issue later

@nicehuster
Copy link
Owner

I'm sorry for the late response. After careful inspection, it was an environmental issue and I switched to the environment where I conducted the experiment. It works fine, but I still can't run it on the newly rebuilt environment. I don't have the energy to accurately locate the problem at the moment. But, I uploaded my conda environment to this link. You can download it and use 'conda activate sp ' to activate the environment.

@revenamar1
Copy link

I also had it (run the code using Google Colab, 1 GPU), and I had to change some config to make it work.

  • GPU number need to be set to X @ test_dist (for me 1)
  • If you're run the code with only 1 GPU, make sure you comment the multiple GPU init on test.py (lines 48-49)
  • You need to set the max feat size related to the hardware you use (512 for what I selected at Colab), and change this function at modules->pointops->functions->pointops.py to be:

def interpolation(xyz, new_xyz, feat, offset, new_offset, k=3):
"""
input: xyz: (m, 3), new_xyz: (n, 3), feat: (m, c), offset: (b), new_offset: (b)
output: (n, c)
"""
assert xyz.is_contiguous() and new_xyz.is_contiguous() and feat.is_contiguous()
idx, dist = knnquery(k, xyz, new_xyz, offset, new_offset) # (n, k), (n, k)

# Ensure indices are within the valid range
idx = torch.clamp(idx, 0, feat.size(0) - 1)

dist_recip = 1.0 / (dist + 1e-8)  # (n, k)
norm = torch.sum(dist_recip, dim=1, keepdim=True)
weight = dist_recip / norm  # (n, k)

new_feat = torch.cuda.FloatTensor(new_xyz.shape[0], feat.shape[1]).zero_()
for i in range(k):
    new_feat += feat[idx[:, i].long(), :] * weight[:, i].unsqueeze(-1)
return new_feat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants