当前位置:网站首页>【MindSpore】多卡训练保存权重问题
【MindSpore】多卡训练保存权重问题
2022-07-30 19:04:00 【小乐快乐】
问题描述:
多卡训练的epoch更多吗?单卡训练只需要5个epoch就可以训练好,8卡训练反而需要85epoch?
训练采用数据并行模式。
如下图,我按rank id分开保存的权重是单卡训练的还是多卡合并的结果?/0/crnn-85_4.ckpt和 /1/crnn-85_4.ckpt是同样的吧?
数据并行,每张卡上的ckpt数据是一样的。
/0/crnn-85_4.ckpt和 /1/crnn-85_4.ckpt 应该是一样的。(只有bn的moving_mean和moving_variance可能有差别,但是不影响推理)
单卡训练只需要5个epoch就可以训练好,8卡训练反而需要85epoch?
这个结论是如何来的呢?比较loss值?
每隔一定step 验证一次模型,发现多卡训练反而需要更多epoch才能达到同样精度.单卡可以5epoch达到0.9,多卡需要40-50epoch。学习率,batchsize不变情况下
我的数据集很小,训练集只有5000样本。batchsize是32.验证码集样本500. 学习率是0.0001。是不是数据集小了,切分数据集反而导致每张卡更难收敛,需要的epoch更多?
解决方案:
batch size一致,是总batch一致,还是单卡的bs和数据并行的其中一张卡bs一致呢。如果是第二种情况,那么数据并行的总bs是比单卡大的,所以收敛会变慢,需要适当调整学习率
边栏推荐
- 牛客刷题系列之进阶版(搜索旋转排序数组,链表内指定区间反转)
- Tensorflow2.0 confusion matrix does not match printing accuracy
- 什么是 RESTful API?
- What is the value of biomedical papers? How to translate the papers into Chinese and English?
- 谷歌AlphaFold近日宣称预测出地球上几乎所有蛋白质结构
- Go 系统收集
- Common linked list problems and their Go implementation
- 【Prometheus】Prometheus联邦的一次优化记录[续]
- Object和Map的区别
- Mysql execution principle analysis
猜你喜欢
Golang logging library zerolog use record
node封装一个控制台进度条插件
自然语言处理nltk
卫星电话是直接与卫星通信还是通过地面站?
MySql中@符号的使用
SwiftUI iOS 精品开源项目之 完整烘焙食品菜谱App基于SQLite(教程含源码)
[Prometheus] An optimization record of the Prometheus federation [continued]
Node encapsulates a console progress bar plugin
The large-scale application of artificial intelligence AI products in industrial-grade mature shipping ports of CIMC World Lianda will create a new generation of high-efficiency smart ports and innova
【hbuilder】运行不了部分项目 , 打开终端 无法输入指令
随机推荐
Critical Reviews | A review of the global distribution of antibiotics and resistance genes in farmland soil by Nannong Zou Jianwen's group
AI基础:图解Transformer
【科普】无线电波怎样传送信息?
Mysql execution principle analysis
6块钱1斤,日本公司为何来中国收烟头?
AWS console
深入浅出边缘云 | 3. 资源配置
nlohmann json 使用指南【visual studio 2022】
【Pointing to Offer】Pointing to Offer 22. The kth node from the bottom in the linked list
第4章 控制执行流程
Hello, my new name is "Bronze Lock/Tongsuo"
谷歌AlphaFold近日宣称预测出地球上几乎所有蛋白质结构
DM8:单库单实例搭建本地数据守护服务
Anaconda Navigator stuck on loading applications
Object和Map的区别
- daily a LeetCode 】 【 191. A number of 1
Vulkan开启特征(feature)的正确姿势
一文读懂“语言模型”
第十七届“振兴杯”全国青年 职业技能大赛——计算机程序设计员(云计算平台与运维)参赛回顾与总结
[Summary] 1396- 60+ VSCode plugins to create a useful editor