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

Unexpected cuda allocate in the knn_points function #1922

Open
pengc02 opened this issue Dec 8, 2024 · 0 comments
Open

Unexpected cuda allocate in the knn_points function #1922

pengc02 opened this issue Dec 8, 2024 · 0 comments

Comments

@pengc02
Copy link

pengc02 commented Dec 8, 2024

Hi guys, I met a problem here:

import torch
from pytorch3d.ops import knn_points
import ipdb
points = torch.rand(1000, 3)
device = "cuda"

with torch.no_grad():
    fused_point_cloud = points.float().to(device)
    dist2 = torch.clamp_min(
        knn_points(fused_point_cloud[None], fused_point_cloud[None], K=4)[0][0, :, 1:].mean(-1),
        1e-7
    ).cpu().detach().clone()
    fused_point_cloud = fused_point_cloud.cpu().detach().clone()
    
ipdb.set_trace()

image

As i move all the variables to cpu, there should not be any cuda allocate, however there is still some cuda memory allocate when it runs to the 'ipdb.set_trace()'. I wonder if it's a bug or just i missused something.

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

1 participant