最近在学习基于深度学习的点云分割算法,关注到牛津大学胡庆拥博士提出的RandLa-Net网络应用于城市级别的点云语义分割,所以想来复现一下。复现过程所参照的博文和代码如下(排序不分先后。没有各位大佬的分享,晚辈们必定寸步难行,感激不尽):

1、https://github.com/QingyongHu/RandLA-Net

2、https://zhuanlan.zhihu.com/p/105433460

3、https://github.com/luckyluckydadada/randla-net-tf2

4、在RTX 3090上复现点云语义分割算法RandLA-net_randlanet 3090-CSDN博客

5、Ubuntu18.04/20.04复现算法RandLa-net 数据集S3DIS_randlanet复现-CSDN博客

原论文代码的环境是python3.5+tensorflow1.11+cuda9(Hu Q, Yang B, Xie L, et al. Randla-net: Efficient semantic segmentation of large-scale point clouds[C]//Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. 2020: 11108-11117.)

我学习复现的代码:https://github.com/luckyluckydadada/randla-net-tf2.git

我的复现环境:

RTX 4090 + Ubuntu20.04  + cuda12.1 + cudnn

Python 3.8, Tensorflow 2.4.1

复现步骤(Ubuntu系统终端):

conda create -n randlanet38 python=3.8
conda activate randlanet38
pip install tensorflow-gpu==2.4.1 -i https://pypi.tuna.tsinghua.edu.cn/simple  --timeout=120
cd /home/feng/PycharmProjects/randla-net-tf2-main
pip install -r helper_requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple  --timeout=120

注意:cd后面的路径根据自己情况修改!

“helper_requirements.txt“ 内容如下(如果不清楚自己安装的python环境和tensorflow、numpy等工具版本是否兼容的?可以尝试多问问大语言模型,本人也是在求助了多次AI之后,才最终得以解决版本适配的问题,多尝试几次总会成功):

numpy==1.20.3
h5py==3.1.0
cython==0.29.36
open3d==0.13.0
pandas==1.2.5
scikit-learn==0.24.2
scipy==1.6.3
PyYAML==5.4.1

sh compile_op.sh

在/home/feng/PycharmProjects/randla-net-tf2-main/data/S3DIS 下预存好Stanford3dDataset_v1.2_Aligned_Version 数据集;运行下面代码以准备好带注释的S3DIS数据集

python utils/data_prepare_s3dis.py

data_prepare_s3dis.py代码中涉及的路径可以最好像我一样直接给出绝对路径(这样最简单,不容易出错,如果有更好的解决办法,欢迎评论区留言):

python -B main_S3DIS.py --gpu 0 --mode train --test_area 1

 注意:上方代码如果报错类似下面这种:

ValueError: attempt to get argmin of an empty sequence
[[{{node PyFunc}}]]
[[IteratorGetNext]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main_S3DIS.py", line 300, in <module>
model.train(dataset)
File "/home/user/randla-net-tf2/RandLANet.py", line 290, in train
print(e.op.name)
AttributeError: 'NoneType' object has no attribute 'name'

可以尝试:定位到main_S3DIS.py中的 self.path = "/home/" + getpass.getuser() + "/data/S3DIS/" 将其修改为完整的文件夹路径即可,本人电脑的路径为: self.path = '/home/feng/PycharmProjects/randla-net-tf2-main/data/S3DIS/'

终端中显示下面内容(说明已经在正常训练啦):

经验之谈:可以将最大迭代次数调整到20次左右,下面是第23次迭代的结果:

欢迎点赞、收藏+转发,有问题随时评论区或私信交流,也尽情关注WX公众号“GRACE8Hydrology”  感谢支持

To be better!!!

Logo

脑启社区是一个专注类脑智能领域的开发者社区。欢迎加入社区,共建类脑智能生态。社区为开发者提供了丰富的开源类脑工具软件、类脑算法模型及数据集、类脑知识库、类脑技术培训课程以及类脑应用案例等资源。

更多推荐