当前位置:网站首页>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!
边栏推荐
- 租房小程序登顶码云热门
- 浅谈运用低代码技术如何实现物流企业的降本增效
- 机器学习(十三):支持向量机(SVM)
- 并发编程原理学习-reentrantlock源码分析
- 软件基础的理论
- 海报 | 夏季高温,危化品安全风险的注意事项必须get!
- (1), the sequential storage structure of linear table chain storage structure
- To eliminate asynchronous callbacks, it has to be async-await
- Learning to Explore - Setting the Foreground Color for Fonts
- WEB 渗透之逻辑漏洞
猜你喜欢

泰坦尼克号沉船数据之美——起于悲剧,止于浪漫

How to convert an int attribute into a string in the json format returned by the Go language gin framework?

全球电子产品需求萎靡:三星越南工厂大幅压缩产能,减少工人工作日

通关剑指 Offer——剑指 Offer II 010. 和为 k 的子数组

【LeetCode每日一题】——540.有序数组中的单一元素

Codeforces Round #811 (Div. 3)

御神楽的学习记录之基于FPGA的AHT10温湿度数据采集

pyhon爬虫之爬取图片(亲测可用)

Understand Chisel language. 32. Chisel advanced hardware generator (1) - parameterization in Chisel

华硕win11安全启动如何开启
随机推荐
R语言缺失时间序列的填充及合并:补齐时间序列数据中所有缺失的时间索引、使用merge函数合并日期补齐之后的时间序列数据和另外一个时间序列数据(补齐左侧数据)
抖音最重要的接口——item_search_video-根据关键词获取视频列表
xgboost模块param中的一些错误
Flutter实战-请求封装(四)之gzip报文压缩
软件基础的理论
《机器学习的随机矩阵方法》
SRM供应商协同管理系统功能介绍
消灭异步回调,还得是async-await
R语言ggplot2可视化:使用patchwork包的plot_layout函数将多个可视化图像组合起来,nrow参数指定行的个数、byrow参数指定按照列顺序排布图
并发编程原理学习-reentrantlock源码分析
R语言ggplot2可视化:使用ggpubr包的ggbarplot函数可视化柱状图、color参数指定柱状图的边框的色彩
一张图片怎么旋转90度。利用ps
使用Redis做某个时间段在线数统计
win11如何退出安全模式
【论文阅读】Decision Transformer: Reinforcement Learning via Sequence Modeling
【 Gazebo introductory tutorial] speak the second model library into robot modeling and visualization (editor) model
化学制品制造业数智化供应链管理系统:打造智慧供应体系,赋能企业产效提升
在VMD上可视化hdf5格式的分子轨迹文件
The use of QCompleter for Qt auto-completion
安装win11提示开启安全模式如何解决