模型:Point-GNN
环境:cuda 11.1 python 3.8 tensorflow 2.4.1 open3d 0.16.0
在运行run.py的时候,因为使用的cuda、python、tensorflow等版本都太高,导致open3d的版本也很高,一些方法所在的包已经修改,所以对源码进行相应的修改,比如:
pcd = open3d.PointCloud()
要改为:
pcd = open3d.geometry.PointCloud()
修改规则可以对照:module ‘open3d‘ has no attribute ‘xxx‘_sun_m_s的博客-CSDN博客
在graph_gen文件的multi_layer_downsampling中进行下采样时:
pcd = open3d.PointCloud()
pcd.points = open3d.Vector3dVector(points_xyz)
downsampled_xyz = np.asarray(open3d.voxel_down_sample(
pcd, voxel_size = base_voxel_size*level).points)
downsampled_list.append(downsampled_xyz)
运行后报错:
AttributeError: module 'open3d' has no attribute 'voxel_down_sample'
上面的博客中没有提及voxel_down_sample被封装在哪里了,但是可以在open3d 0.16.0的官方文档中进行查找:
Point cloud — Open3D 0.16.0 documentation文章来源地址https://www.toymoban.com/news/detail-524647.html
发现voxel_down_sample已经被重新封装在open3d.geometry.PointCloud()中,所以要将代码修改为:
pcd = open3d.geometry.PointCloud()
pcd.points = open3d.utility.Vector3dVector(points_xyz)
downsampled_xyz = np.asarray(
pcd.voxel_down_sample(voxel_size=base_voxel_size * level).points)
downsampled_list.append(downsampled_xyz)
错误解决。
参考文献:
https://github.com/WeijingShi/Point-GNN
module ‘open3d‘ has no attribute ‘xxx‘_sun_m_s的博客-CSDN博客
Open3D: A Modern Library for 3D Data Processing — Open3D 0.16.0 documentation文章来源:https://www.toymoban.com/news/detail-524647.html
Point cloud — Open3D 0.16.0 documentation
到了这里,关于AttributeError: module ‘open3d‘ has no attribute ‘voxel_down_sample‘的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!