PointNet pytorch学习(小白踩坑日记)

3D视觉小白,第一次写文章,若有不正确的地方,烦请指出。

一、源码、论文、数据集下载

1、源码下载:https://github.com/fxia22/pointnet.pytorch

2、论文下载:https://arxiv.org/abs/1612.00593

3、数据集下载

(1)shapenet数据集:https://shapenet.cs.stanford.edu/ericyi/shapenetcore_partanno_segmentation_benchmark_v0.zip

(2)modelnet40数据集:http://modelnet.cs.princeton.edu/#

二、代码运行

1、git代码下载
git clone https://github.com/fxia22/pointnet.pytorch
cd pointnet.pytorch
pip install -e .  //pip自动将包复制到site-packages
2、下载和构建可视化工具
cd script
bash build.sh #build C++ code for visualization
bash download.sh #download dataset

3、训练
cd utils
python train_classification.py --dataset shapenet(或者modelnet40)

三、问题集锦(以train_classification为例)

环境:windows10+python38+NVDIA GTX950M;

(1)安装cuda和cudnn,参考博文:https://www.cnblogs.com/guan-zl/p/12986253.html,https://blog.csdn.net/qq_37296487/article/details/83028394;

(2)安装的torch与cuda版本不匹配,测试时torch.cuda.is_available()返回false。解决办法:卸载torch,下载对应cuda的torch,注意对应python版本。

(3)出现错误:RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.This probably means that you are not using fork to start yourchild processes and you have forgotten to use the proper idiom in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable.

解决方法:将train_classification.py文件中的代码放到def main(argv=None):函数体中,在该函数下方调用:

if __name__=='__main__':

        sys.exit(main())

(4)训练出现错误RuntimeError: CUDA out of memory. Tried to allocate 14.00 MiB (GPU 0; 6.00 G),本人开始参考https://blog.csdn.net/weixin_41529093/article/details/114780036博文,减小batchsize,本人将batchsize从32分别调整到16,8,4,但并没有解决。出现新问题:OSError: [WinError 1455] 页面文件太小,无法完成操作的问题,解决方法参考:https://www.cnblogs.com/20183544-wangzhengshuai/p/14814459.html,将代码'--workers', type=int, help='number of data loading workers', default=4)中的default改成0,同时将batchsize调小,解决该问题。

(5)出现错误ValueError: Expected more than 1 value per channel when training, got input size ...,解决方法参考博文:https://blog.csdn.net/weixin_44790486/article/details/106641833。

最后,感谢各位大佬的分享和贡献,让我这样的技术小白,遇到问题可以有地方可问,感恩and努力。

你可能感兴趣的:(PointNet,Python,pytorch,python,pytorch,计算机视觉,深度学习,人工智能)