遇到报错:
TypeError: expected np.ndarray (got PlyData)
报错部分:
def main():
args = options()
torch.backends.cudnn.deterministic = True
if args.user_data:
sourceR = PlyData.read(r'E:\bunny\data\bun000.ply') # The source point cloud is a rotated and offset defect
# source=s3.float()
templateR = PlyData.read(r'E:\bunny\data\bun045.ply') # Template point cloud is complete
# template=s5.float()
source = torch.from_numpy(sourceR) #此处报错
template = torch.from_numpy(templateR)
testset = UserData(template=template, source=source, tpcc=None, igt=None)
torch.from_numpy 函数需要传输的对象是np.ndarry 类型的东西,你现在传输的sourceR 他的对象类型是PlyData
需要进行更改https://blog.csdn.net/weixin_42445581/article/details/105069655
参数类型错了,应该是一个np.ndarray类型,你给的是一个PlyData类型,检查一下sourceR的生成类型