【无标题】

项目场景:

使用ChamferDistancePytorch遇到的错误解决办法。
RuntimeError: Error building extension`:FAILED: chamfer_distance.cuda.o。
ninja: build stopped: subcommand failed.

问题描述

一直报错:RuntimeError: Error building extension`:
FAILED: chamfer_distance.cuda.o。
ninja: build stopped: subcommand failed.

解决方案:

弃用ChamferDistancePytorch,改用pytorh3d.loss.chamfer_distance()

import torch
#from chamfer_distance import ChamferDistance
import time
from pytorch3d import loss

p1 = torch.rand([10,1000,3])
p2 = torch.rand([10,1000,3])

s = time.time()
dist1,idx1 = loss.chamfer_distance(p1,p2)
torch.cuda.synchronize()
print(f"Time: {time.time() - s} seconds")

.

你可能感兴趣的:(pytorch,深度学习,python)