1. 环境
win10
Anaconda3.6
Pytorch1.4
2. PointNet pytorch下载,并下载好数据集
https://github.com/fxia22/pointnet.pytorch
3. Open Terminal
打开Anaconda Navigator——ENvironmens——Pytorch_envs(自己创建的虚拟环境)
左键点击三角图标-Open Terminal
4. 运行命令
(1)进入到pointnet代码文件夹主目录,输入以下命令,安装环境
pip install -e .
(2) 进入utils文件夹
python train_classification.py --dataset=D:\work\paper\0323PointNet\pointnet.pytorch-master\shapenetcore_partanno_segmentation_benchmark_v0\ --nepoch=5 --dataset_type=shapenet
备注:
报错1:Detected call of `lr_scheduler.step()` before `optimizer.step()`
解决办法:https://blog.csdn.net/zfjBIT/article/details/105114526
报错2:The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable.
解决办法:https://blog.csdn.net/zfjBIT/article/details/105117206
报错3:PermissionError: [WinError 5] 拒绝访问
解决办法:https://blog.csdn.net/zfjBIT/article/details/105121116
训练结果:
会生成cls文件夹以及model
python train_segmentation.py --dataset=D:\work\paper\0323PointNet\pointnet.pytorch-master\shapenetcore_partanno_segmentation_benchmark_v0\ --nepoch=5
报错:
[0: 0/83] train loss: 1.375747 accuracy: 0.370837
[0: 0/83] [94mtest[0m loss: 1.389753 accuracy: 0.490475
Traceback (most recent call last):
File "train_segmentation.py", line 88, in
pred, trans, trans_feat = classifier(points)
File "E:\softwareInstallation\Anaconda3\envs\Pytorch_envs\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "d:\work\paper\0323pointnet\pointnet.pytorch-master\pointnet\model.py", line 167, in forward
x, trans, trans_feat = self.feat(x)
File "E:\softwareInstallation\Anaconda3\envs\Pytorch_envs\lib\site-packages\torch\nn\modules\module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "d:\work\paper\0323pointnet\pointnet.pytorch-master\pointnet\model.py", line 127, in forward
return torch.cat([x, pointfeat], 1), trans, trans_feat
RuntimeError: CUDA out of memory. Tried to allocate 334.00 MiB (GPU 0; 6.00 GiB total capacity; 3.99 GiB already allocated; 320.14 MiB free; 4.29 GiB reserved in total by PyTorch)
将batchSize降低到8后可以运行(默认为32):
python train_segmentation.py --dataset=D:\work\paper\0323PointNet\pointnet.pytorch-master\shapenetcore_partanno_segmentation_benchmark_v0\ --nepoch=5 --batchSize=8
训练结果:
会生成seg文件夹以及model
未完待续~~~~~~~~~~