当前位置:网站首页>【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是比单卡大的,所以收敛会变慢,需要适当调整学习率
边栏推荐
- Golang logging library zerolog use record
- scrapy基本使用
- Scala学习:类和对象
- SimpleOSS third-party library libcurl and engine libcurl error solution
- AI基础:图解Transformer
- Tensorflow2.0 confusion matrix does not match printing accuracy
- MindSpore:对image作normalize的目的是什么?
- 深入浅出边缘云 | 3. 资源配置
- Node encapsulates a console progress bar plugin
- [Use of Qt Designer tool]
猜你喜欢

卫星电话是直接与卫星通信还是通过地面站?

阿里云武林头条活动分享

经济新闻:错误# 15:初始化libiomp5md。dll,但发现libiomp5md。已经初始化dll。解决方法

SimpleOSS第三方库libcurl与引擎libcurl错误解决方法

natural language processing nltk

SwiftUI iOS Boutique Open Source Project Complete Baked Food Recipe App based on SQLite (tutorial including source code)

牛客刷题系列之进阶版(搜索旋转排序数组,链表内指定区间反转)

深入浅出边缘云 | 3. 资源配置

Codeblocks + Widgets create window code analysis

Deepen school-enterprise cooperation and build an "overpass" for the growth of technical and skilled talents
随机推荐
The advanced version of the Niu Ke brushing series (team competition, sorting subsequences, inverting strings, deleting common characters, repairing pastures)
延时队列优化 (2)
C# wpf 无边框窗口添加阴影效果
电脑死机的时候,发生了什么?
C# wpf borderless window add shadow effect
MindSpore:【JupyterLab】查看数据时报错
深入浅出边缘云 | 3. 资源配置
Swiper rotates pictures and plays background music
MindSpore:【模型训练】【mindinsight】timeline的时间和实际用时相差很远
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
Go 系统收集
Pytorch foundation -- tensorboard use (1)
VBA批量将Excel数据导入Access数据库
Listen to the boot broadcast
redis
MindSpore: CV.Rescale(rescale,shift)中参数rescale和shift的含义?
Immersive experience iFLYTEK 2022 Consumer Expo "Official Designated Product"
Object和Map的区别
Tensorflow2.0 confusion matrix does not match printing accuracy
MYSQL (Basic) - An article takes you into the wonderful world of MYSQL