目录
1.Windows11环境配置
2.Ubuntu环境配置
3.训练教程
3.1分类(Classification)训练
3.2零件分割(Part Segmentation)训练
3.3场景分割(Semantic Segmentation)训练
代码地址
这里主要是pytorch的安装比较重要,其他的包没有太多的限制。
我的电脑配置:
系统:Windows11 处理器:R7000P 显卡:3060
由于是Windows系统,可以不安装cuda和cudnn,使用anaconda来安装GPU版本的pytorch即可。
anaconda的深度学习环境信息如下:
Python版本:3.7
torch版本:1.11.0+cuda11.3(通过官方命令安装,教程比较多,就不放命令了)
其他安装包版本信息:
absl-py 1.3.0
antlr4-python3-runtime 4.9.3
astunparse 1.6.3
attr 0.3.2
attrs 22.1.0
backcall 0.2.0
brotlipy 0.7.0
cachetools 5.2.0
certifi 2022.9.24
cffi 1.15.1
charset-normalizer 2.0.4
colorama 0.4.6
coloredlogs 15.0.1
commonmark 0.9.1
coremltools 6.1
cryptography 38.0.1
cvms 0.1.1
cycler 0.11.0
decorator 5.1.1
einops 0.6.0
fairscale 0.4.6
filelock 3.9.0
flatbuffers 1.12
fonttools 4.38.0
gast 0.4.0
gitdb 4.0.10
GitPython 3.1.31
google-auth 2.14.0
google-auth-oauthlib 0.4.6
google-pasta 0.2.0
grpcio 1.50.0
h5py 3.8.0
huggingface-hub 0.12.0
humanfriendly 10.0
idna 3.4
imageio 2.31.2
importlib-metadata 5.0.0
ipython 7.34.0
jedi 0.18.1
keras 2.9.0
Keras-Preprocessing 1.1.2
kiwisolver 1.4.4
libclang 14.0.6
lxml 4.9.3
Markdown 3.4.1
MarkupSafe 2.1.1
matplotlib 3.5.3
matplotlib-inline 0.1.6
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
mpmath 1.2.1
networkx 2.6.3
numpy 1.21.5
oauthlib 3.2.2
omegaconf 2.3.0
onnx 1.12.0
onnx-simplifier 0.4.0
onnxruntime 1.13.1
onnxruntime-gpu 1.12.0
onnxsim-no-ort 0.4.0
opencv-python 4.6.0.66
opt-einsum 3.3.0
packaging 20.9
pandas 1.3.5
parso 0.8.3
pickleshare 0.7.5
Pillow 9.2.0
pip 22.2.2
prompt-toolkit 3.0.32
protobuf 3.20.0
psutil 5.9.4
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycparser 2.21
Pygments 2.13.0
pyOpenSSL 22.0.0
pyparsing 3.0.9
pyreadline 2.1
PySocks 1.7.1
python-dateutil 2.8.2
pytz 2022.6
PyWavelets 1.3.0
PyYAML 6.0
requests 2.28.1
requests-oauthlib 1.3.1
rich 12.6.0
rsa 4.9
scikit-image 0.19.3
scikit-learn 0.19.2
scipy 1.7.3
seaborn 0.12.1
setuptools 63.2.0
six 1.16.0
smmap 5.0.0
sympy 1.10.1
tensorboard 2.9.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.1
tensorflow 2.9.0
tensorflow-estimator 2.9.0
tensorflow-hub 0.12.0
tensorflow-intel 2.11.0
tensorflow-io-gcs-filesystem 0.27.0
tensorflowjs 3.19.0
termcolor 2.1.0
thop 0.1.1.post2209072238
tifffile 2021.11.2
timm 0.6.12
torch 1.11.0
torchaudio 0.11.0
torchsummary 1.5.1
torchvision 0.12.0
tqdm 4.64.1
traitlets 5.5.0
typing_extensions 4.3.0
urllib3 1.26.12
wcwidth 0.2.5
Werkzeug 2.2.2
wheel 0.37.1
win-inet-pton 1.1.0
wincertstore 0.2
wrapt 1.14.1
zipp 3.10.0
1.显卡:华硕 ATS GeForce RTX4070-o12G-GAMING
20.04 显卡驱动版本:NVIDIA-Linux-x86_64-535.129.03.run
cuda :
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0
cudnn:
cudnn-linux-x86_64-8.9.5.30_cuda11-archive
通过anaconda配置的环境,在官网找的命令安装的,版本是2.1.0+cu118
在ubuntu中cuda版本要完全对应才能用,比如我的全是11.8版本。
其他安装包版本:
absl-py 2.0.0
asttokens 2.4.1
backcall 0.2.0
Brotli 1.0.9
cachetools 5.3.2
certifi 2023.7.22
charset-normalizer 3.3.2
contourpy 1.1.1
cycler 0.12.1
decorator 5.1.1
einops 0.7.0
executing 2.0.1
filelock 3.9.0
fonttools 4.44.3
fsspec 2023.12.2
gmpy2 2.1.2
google-auth 2.25.2
google-auth-oauthlib 1.0.0
grpcio 1.60.0
huggingface-hub 0.19.4
idna 3.4
importlib-metadata 7.0.1
importlib-resources 6.1.1
ipython 8.12.3
jedi 0.19.1
Jinja2 3.1.2
kiwisolver 1.4.5
Markdown 3.5.1
MarkupSafe 2.1.1
matplotlib 3.7.4
matplotlib-inline 0.1.6
mkl-fft 1.3.1
mkl-random 1.2.2
mkl-service 2.4.0
mpmath 1.3.0
networkx 3.1
numpy 1.24.3
oauthlib 3.2.2
olefile 0.46
opencv-python 4.8.1.78
packaging 23.2
pandas 2.0.3
parso 0.8.3
pexpect 4.9.0
pickleshare 0.7.5
Pillow 8.2.0
pip 23.3
prompt-toolkit 3.0.43
protobuf 3.20.0
psutil 5.9.6
ptyprocess 0.7.0
pure-eval 0.2.2
pyasn1 0.5.1
pyasn1-modules 0.3.0
pycocotools 2.0.7
Pygments 2.17.2
pyparsing 3.1.1
PySocks 1.7.1
python-dateutil 2.8.2
pytz 2023.3.post1
PyYAML 6.0.1
requests 2.31.0
requests-oauthlib 1.3.1
rsa 4.9
safetensors 0.4.1
scipy 1.10.1
seaborn 0.13.0
setuptools 68.0.0
six 1.16.0
stack-data 0.6.3
sympy 1.11.1
tensorboard 2.14.0
tensorboard-data-server 0.7.2
thop 0.1.1.post2209072238
timm 0.9.12
torch 2.1.0+cu118
torchaudio 2.1.0+cu118
torchvision 0.16.0+cu118
tqdm 4.66.1
traitlets 5.14.0
triton 2.1.0
typing_extensions 4.8.0
tzdata 2023.3
urllib3 2.1.0
wcwidth 0.2.12
Werkzeug 3.0.1
wheel 0.41.2
zipp 3.17.0
数据下载:下载ModelNet到data/modelnet40_normal_resampled/
训练命令:我使用的pycharm,直接在pycharm中打开终端,运行命令
# ModelNet40
## Select different models in ./models
## e.g., pointnet2_ssg without normal features
python train_classification.py --model pointnet2_cls_ssg --log_dir pointnet2_cls_ssg
python test_classification.py --log_dir pointnet2_cls_ssg
## e.g., pointnet2_ssg with normal features
python train_classification.py --model pointnet2_cls_ssg --use_normals --log_dir pointnet2_cls_ssg_normal
python test_classification.py --use_normals --log_dir pointnet2_cls_ssg_normal
## e.g., pointnet2_ssg with uniform sampling
python train_classification.py --model pointnet2_cls_ssg --use_uniform_sample --log_dir pointnet2_cls_ssg_fps
python test_classification.py --use_uniform_sample --log_dir pointnet2_cls_ssg_fps
# ModelNet10
## Similar setting like ModelNet40, just using --num_category 10
## e.g., pointnet2_ssg without normal features
python train_classification.py --model pointnet2_cls_ssg --log_dir pointnet2_cls_ssg --num_category 10
python test_classification.py --log_dir pointnet2_cls_ssg --num_category 10
数据准备:下载ShapeNet 到data/shapenetcore_partanno_segmentation_benchmark_v0_normal/
训练命令:
python train_partseg.py --model pointnet2_part_seg_msg --normal --log_dir pointnet2_part_seg_msg
python test_partseg.py --normal --log_dir pointnet2_part_seg_msg
数据准备:下载S3DIS到data/s3dis/Stanford3dDataset_v1.2_Aligned_Version/
cd data_utils
python collect_indoor3d_data.py
python train_semseg.py --model pointnet2_sem_seg --test_area 5 --log_dir pointnet2_sem_seg
python test_semseg.py --log_dir pointnet2_sem_seg --test_area 5 --visual
PS:前两行命令是数据处理的命令,主要是进行数据读取和生成相应的训练数据格式,在Ubuntu上是正常运行的,在Windows上运行会失败,无法生成训练用的数据格式,所以最好在Ubuntu上训练,如果一定要用Windows,可以ubuntu上生成数据格式在导到Windows上,数据生成不需要安装torch