AttributeError: module ‘open3d‘ has no attribute ‘voxel_down_sample‘

这篇具有很好参考价值的文章主要介绍了AttributeError: module ‘open3d‘ has no attribute ‘voxel_down_sample‘。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

模型: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

Point cloud — Open3D 0.16.0 documentation

到了这里,关于AttributeError: module ‘open3d‘ has no attribute ‘voxel_down_sample‘的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • AttributeError: module ‘numpy‘ has no attribute ‘float‘

    出现这个问题的原因是:从numpy1.24起删除了numpy.bool、numpy.int、numpy.float、numpy.complex、numpy.object、numpy.str、numpy.long、numpy.unicode类型的支持。解决上诉问题主要有两种方法: 安装numpy1.24之前的版本 可以用python内置类型或者np.ndarray类型替换: np.float替换为float或者np.float64/np.fl

    2024年02月11日
    浏览(31)
  • AttributeError: module ‘torch‘ has no attribute ‘concat‘

        如图上所示报错地方 在跑算法代码的时候,发现报错,但是这个错误在网上没有找到,我推测是pytorch改版问题,于是查看torch版本改动,发现torch.concat改版后该写为torch.cat。不过或许我写的也不够准确,除此之外还看到了有人问torch.concat和torch.cat的区别。     不过出现

    2024年02月16日
    浏览(39)
  • AttributeError: module ‘distutils‘ has no attribute ‘version‘

    问题: AttributeError: module ‘distutils’ has no attribute ‘version’. 解决: setuptools版本问题”,版本过高导致的问题;setuptools版本 第一步: pip uninstall setuptools 【使用pip,不能使用 conda uninstall setuptools ; 【不能使用conda的命令,原因是,conda在卸载的时候,会自动分析与其相关的库

    2024年02月16日
    浏览(34)
  • AttributeError: module ‘torch‘ has no attribute ‘cuda‘

    系统环境是Linux ,显卡:nvida-T4。 看了下原因为没有装pytorch。 (印象中是装了的不知道什么时候这台服务器没有了。。) 解决方案:到pytorch官网上找到对应的cuda版本的pytorch安装即可 Previous PyTorch Versions | PyTorch 比如我的是cuda 10.2(使用nvcc -V命令查看) 那么就是使用以下命

    2024年02月12日
    浏览(49)
  • 解决AttributeError: module ‘serial‘ has no attribute ‘Serial‘

    最近在搞上位机时遇到了报错AttributeError: module ‘serial’ has no attribute ‘Serial’,翻译过来就是serial类没有Serial对象。然后卡了一个小时才解决,试了网上很多方法,最后才发现报错原因,这问题python也有责任。 下面说下一般的解决方法。 python3之后串口都改为pyserial,seria

    2024年02月02日
    浏览(36)
  • 解决AttributeError: module tensorflow has no attribute placeholder

    目录 解决AttributeError: module \\\'tensorflow\\\' has no attribute \\\'placeholder\\\' 方法一:升级TensorFlow版本 方法二:使用tf.compat.v1.placeholder替代 方法三:重写代码 应用场景 示例代码 Placeholder 创建和使用placeholder 为placeholder提供数值 placeholder的应用场景 如果你在使用TensorFlow时遇到了\\\"AttributeEr

    2024年02月05日
    浏览(30)
  • AttributeError: module ‘numpy‘ has no attribute ‘bool‘解决

    问题原因:在numpy的1.24版本已经弃用了np.bool这个名称,取而代之的是np.bool_ 解决方法: 1.点击出错文件 2.将np.bool更改为np.bool_

    2024年02月12日
    浏览(81)
  • 【已解决】AttributeError: module ‘numpy‘ has no attribute ‘int‘.

    AttributeError: module ‘numpy’ has no attribute ‘int’. np.int was a deprecated alias for the builtin int . To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. 新版本的numpy里面没有np.int了。 第一种,降低numpy版本,安装1.20以下的版本。 第二种,修改源码。 将 修

    2024年02月14日
    浏览(26)
  • 成功解决AttributeError: module ‘numpy‘ has no attribute ‘float‘.

    AttributeError: module ‘numpy’ has no attribute ‘float’. np.float was a deprecated alias for the builtin float . To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here. The aliases was originally deprecated in NumPy 1.20; for

    2024年02月16日
    浏览(47)
  • AttributeError: module ‘numpy‘ has no attribute ‘array‘解决办法

    NumPy是Python中重要的数值计算库,提供了强大的数组操作和数学函数。然而,有时候我们可能会在使用NumPy时遇到\\\"AttributeError: module ‘numpy’ has no attribute ‘array’\\\"的错误提示,这可能会让一些用户感到困惑。在本文中,我们将分享如何解决这个问题的方法,并帮助读者更好地

    2024年02月13日
    浏览(47)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包