当前位置:网站首页>mmdetection/mmdetection3d多机多卡训练
mmdetection/mmdetection3d多机多卡训练
2022-08-04 17:17:00 【烤粽子】
因为3d检测训练时间太久,所以想要在mmdet3d上开多机,发现加载完标注文件pkl/json之后,卡住了,找到如下报错


其中有个warning :using best-guess GPU, 大概率是rank不对,
找到相关代码:
def init_dist(launcher, backend='nccl', **kwargs):
if mp.get_start_method(allow_none=True) is None:
mp.set_start_method('spawn')
if launcher == 'pytorch':
_init_dist_pytorch(backend, **kwargs)
elif launcher == 'mpi':
_init_dist_mpi(backend, **kwargs)
elif launcher == 'slurm':
_init_dist_slurm(backend, **kwargs)
else:
raise ValueError(f'Invalid launcher type: {
launcher}')
def _init_dist_pytorch(backend, **kwargs):
# TODO: use local_rank instead of rank % num_gpus
rank = int(os.environ['RANK'])
local_rank = int(os.environ["LOCAL_RANK"])
num_gpus = torch.cuda.device_count()
# torch.cuda.set_device(rank % num_gpus)
torch.cuda.set_device(local_rank)
dist.init_process_group(backend=backend, **kwargs)
# device = torch.device("cuda", local_rank)
没什么问题,按照提示修改torch.cuda.set_device(local_rank)还是不work,
怀疑环境没搞对,增加环境初始化:
def configure_nccl():
import subprocess
os.environ["NCCL_LAUNCH_MODE"] = ""
os.environ["NCCL_IB_DISABLE"] = "0"
os.environ["NCCL_IB_HCA"] = subprocess.getoutput(
"cd /sys/class/infiniband/ > /dev/null; for i in mlx5_*; "
"do cat $i/ports/1/gid_attrs/types/* 2>/dev/null "
"| grep v >/dev/null && echo $i ; done; > /dev/null"
)
os.environ["NCCL_IB_GID_INDEX"] = "3"
os.environ["NCCL_IB_TC"] = "106"
work!
边栏推荐
- 88. (the home of cesium) cesium polymerization figure
- Cron表达式
- R语言使用cov函数计算矩阵或者dataframe数据变量之间的协方差、cor函数计算相关性、cor函数通过method参数指定相关性、相关性计算方法Pearson,Spearman, Kendall
- 【LeetCode每日一题】——540.有序数组中的单一元素
- 御神楽的学习记录之基于FPGA的AHT10温湿度数据采集
- .NET云原生应用发展论坛--8月7日邀你一起云上探索
- 从云计算到函数计算
- 乐享购(分享购)的模式:优势、亮点、收益
- R语言glm函数使用频数数据构建二分类logistic回归模型,分析的输入数据为频数数据(多个分类指标对应的阴性样本和阳性样本的频数数据)、weights参数指定频数值
- 太一集团宣布全资收购火币旗下社交产品火信
猜你喜欢

yarn detailed introductory tutorial

IDEA以多端口启动同一个服务项目

Catering Supply Chain Management System

华为云数据治理生产线DataArts,让“数据‘慧’说话”

如何模拟后台API调用场景,很细!

【Gazebo入门教程】第二讲 模型库导入与可视化机器人建模(模型编辑器)

化学制品制造业数智化供应链管理系统:打造智慧供应体系,赋能企业产效提升

15 days to upgrade to fight monsters and become a virtual fashion creator
The second step through MySQL in four steps: MySQL index learning

Flutter实战-请求封装(四)之gzip报文压缩
随机推荐
The use of QCompleter for Qt auto-completion
Json的FastJson与Jackson
NLP未来,路在何方?从学术前沿和业界热点谈起
SAP ABAP SteammPunk 蒸汽朋克的最新进展 - 嵌入式蒸汽朋克
太一集团全资收购火币旗下社交产品火信
设置表头颜色
【图像分类】2021-DeiT
】 【 LeetCode daily one problem - 540. The order of a single element of the array
R语言计算时间序列数据的逐次差分(successive differences):使用diff函数计算时间序列数据的逐次差分值
hi, 请问下这是什么问题, 我看官网的example就是mysql的, 咋提示不支持?
接口测试项目(非常值得练手)
mysql学习笔记——利用动态SQL和Session变量实现一个公式或者计算器
拼多多详情API接口深度解读
【小程序】实现发动态功能
WPF 光标初始化的时候 temp 文件夹满了无法创建
学习探索-网站中引入百度统计
What does the product system of a digital financial enterprise look like?
软件基础的理论
全球电子产品需求萎靡:三星越南工厂大幅压缩产能,减少工人工作日
提高图片清晰度的快速方法?