H20训练CPGNET环境搭建

1、本地cuda安装

版本:12.1

sudo sh cuda_12.1.1_530.30.02_linux.run

echo 'export CUDA_HOME=/usr/local/cuda-12.1' >> ~/.bashrc

echo 'export PATH=CUDAHOME/bin:CUDA_HOME/bin:CUDAHOME/bin:PATH' >> ~/.bashrc

echo 'export LD_LIBRARY_PATH=CUDAHOME/lib64:CUDA_HOME/lib64:CUDAHOME/lib64:LD_LIBRARY_PATH' >> ~/.bashrc

source ~/.bashrc

2、torch安装

pip install torch2.4.1 torchvision0.19.1 torchaudio2.4.1 --index-url https://download.pytorch.org/whl/cu121
3、依赖环境安装
训练环境:
pip install pyyaml5.4.1

pip install pyyaml

pip install opencv-python

pip install scipy pip install nuscenes-devkit

pip install mmcv==2.2.0 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.4/index.html

pkl生成环境:

pip install terminaltables

pip install requests

pip install numba

pip install xlwt

4、代码修改

4.1 Traceback (most recent call last):

File "/home/foton/M/temp/Project/generate_pkl/tools/create_data.py", line 11, in

from det3d.datasets.kitti import kitti_common as kitti_ds

ModuleNotFoundError: No module named 'det3d'

修改本地路径

4.2 yaml

yaml.load(f),但 PyYAML ≥ 5.1 之后,出于安全考虑,yaml.load()必须显式指定 Loader参数,否则会报:

TypeError: load() missing 1 required positional argument: 'Loader'

self.task_cfg = yaml.load(f)

改为:

self.task_cfg = yaml.safe_load(f)

4.3

Python 3.10 中 collections.Iterable已被移除,而 det3d代码中还在使用旧的导入方式。

from collections import Iterable, defaultdict

修改后:

from collections.abc import Iterable

from collections import defaultdict

4.4

warnings.warn(warning.format(ret))

rank0: Traceback (most recent call last):

rank0: File "/home/foton/M/temp/Project/CPGNet/train.py", line 260, in

rank0: main(args, config)

rank0: File "/home/foton/M/temp/Project/CPGNet/train.py", line 209, in main

rank0: model = torch.nn.parallel.DistributedDataParallel(base_net.to(device),

rank0: File "/home/foton/miniconda3/envs/cpg/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 822, in init

rank0: _verify_param_shape_across_processes(self.process_group, parameters)

rank0: File "/home/foton/miniconda3/envs/cpg/lib/python3.10/site-packages/torch/distributed/utils.py", line 286, in _verify_param_shape_across_processes

rank0: return dist._verify_params_across_processes(process_group, tensors, logger)

rank0: torch.distributed.DistBackendError: NCCL error in: .../torch/csrc/distributed/c10d/NCCLUtils.hpp:275, unhandled cuda error (run with NCCL_DEBUG=INFO for details), NCCL version 2.20.5

rank0: ncclUnhandledCudaError: Call to CUDA function failed.

rank0: Last error:

rank0: Cuda failure 802 'system not yet initialized'

rank3: Traceback (most recent call last):

rank3: File "/home/foton/M/temp/Project/CPGNet/train.py", line 260, in

rank3: main(args, config)

rank3: File "/home/foton/M/temp/Project/CPGNet/train.py", line 209, in main

rank3: model = torch.nn.parallel.DistributedDataParallel(base_net.to(device),

rank3: File "/home/foton/miniconda3/envs/cpg/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 822, in init

rank3: _verify_param_shape_across_processes(self.process_group, parameters) n many cases (e.g. in a constructor) irank3: File "/home/foton/miniconda3/envs/cpg/lib/python3.10/site-packages/torch/distributed/utils.py", line 286, in _verify_param_shape_across_processes of tensor.type().backend() use tensorrank3: return dist._verify_params_across_processes(process_group, tensors, logger)

rank3: torch.distributed.DistBackendError: NCCL error in: .../torch/csrc/distributed/c10d/NCCLUtils.hpp:275, unhandled cuda error (run with NCCL_DEBUG=INFO for details), NCCL version 2.20.5

rank3: ncclUnhandledCudaError: Call to CUDA function failed.

rank3: Last error:

rank3: Cuda failure 802 'system not yet initialized'

rank2: Traceback (most recent call last):

rank2: File "/home/foton/M/temp/Project/CPGNet/train.py", line 260, in

rank2: main(args, config)

rank2: File "/home/foton/M/temp/Project/CPGNet/train.py", line 209, in main

rank2: model = torch.nn.parallel.DistributedDataParallel(base_net.to(device),

rank2: File "/home/foton/miniconda3/envs/cpg/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 822, in init

rank2: _verify_param_shape_across_processes(self.process_group, parameters)

rank2: File "/home/foton/miniconda3/envs/cpg/lib/python3.10/site-packages/torch/distributed/utils.py", line 286, in _verify_param_shape_across_processes

rank2: return dist._verify_params_across_processes(process_group, tensors, logger)

rank2: torch.distributed.DistBackendError: NCCL error in: .../torch/csrc/distributed/c10d/NCCLUtils.hpp:275, unhandled cuda error (run with NCCL_DEBUG=INFO for details), NCCL version 2.20.5

rank2: ncclUnhandledCudaError: Call to CUDA function failed.

rank2: Last error:

rank2: Cuda failure 802 'system not yet initialized'

rank1: Traceback (most recent call last):

rank1: File "/home/foton/M/temp/Project/CPGNet/train.py", line 260, in

rank1: main(args, config)

rank1: File "/home/foton/M/temp/Project/CPGNet/train.py", line 209, in main

rank1: model = torch.nn.parallel.DistributedDataParallel(base_net.to(device),

rank1: File "/home/foton/miniconda3/envs/cpg/lib/python3.10/site-packages/torch/nn/parallel/distributed.py", line 822, in init

rank1: _verify_param_shape_across_processes(self.process_group, parameters)

rank1: File "/home/foton/miniconda3/envs/cpg/lib/python3.10/site-packages/torch/distributed/utils.py", line 286, in _verify_param_shape_across_processes

rank1: return dist._verify_params_across_processes(process_group, tensors, logger)

rank1: torch.distributed.DistBackendError: NCCL error in: .../torch/csrc/distributed/c10d/NCCLUtils.hpp:275, unhandled cuda error (run with NCCL_DEBUG=INFO for details), NCCL version 2.20.5n many cases (e.g. in a constructor) irank1: ncclUnhandledCudaError: Call to CUDA function failed. of tensor.type().backend() use tensorrank1: Last error:

rank1: Cuda failure 802 'system not yet initialized'

rank0:W611 19:02:58.669442585 ProcessGroupNCCL.cpp:1168 Warning: WARNING: process group has NOT been destroyed before we destruct ProcessGroupNCCL. On normal program exit, the applicatio

用0、1卡没问题

5、nccl与gloo

nccl比gloo快1.5倍

相关推荐
TiannanWu9 小时前
从零手写 autograd:60 行实现反向传播,数值梯度对拍误差 1e-11
深度学习
阿enna10 小时前
候选位置数量为什么是8400
深度学习·神经网络·yolo·目标检测·计算机视觉·cnn·视觉检测
高洁0110 小时前
数字孪生的冷启动#数字孪生 #人工智能 #大模型 #世界模型
深度学习·机器学习·transformer·迁移学习·tornado
邂逅and回眸13 小时前
TinyML 入门:KB 级内存里怎么跑神经网络
人工智能·深度学习·神经网络
tellmewhoisi13 小时前
深度学习1番外篇:sigmoid为啥比Tanh收敛的慢
人工智能·深度学习
汤姆宝库18 小时前
视觉语言模型的实现:LLaVA式投影与指令微调
python·深度学习·语言模型
江润舟1 天前
万物|炼器:从零手搓工业级旋转目标检测网络·卷7 —— OBB检测头与DFL解码(三)
人工智能·python·深度学习
天树星智源2 天前
语言模型分得出 AI 文本却答反了:后训练改的是读法,不是表征(Δd′ = −0.34)
人工智能·深度学习·语言模型
橘子132 天前
神经网络基础
人工智能·深度学习·神经网络
伞伞悦读2 天前
【第92期】逻辑回归的分数概率与阈值的实验与排查
人工智能·python·深度学习·机器学习