Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于学习率的设定的疑惑 #9204

Open
3 tasks done
stephen-TT opened this issue Nov 5, 2024 · 3 comments
Open
3 tasks done

关于学习率的设定的疑惑 #9204

stephen-TT opened this issue Nov 5, 2024 · 3 comments
Assignees

Comments

@stephen-TT
Copy link

问题确认 Search before asking

  • 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

Training

Bug描述 Describe the Bug

使用ppyoloe训练voc数据集的时候,学习率到底该怎么设定;
我看历史issue有的版本说如果gpu是4,则设为0.005,还有的版本给了一个学习率的设定公式,我到底以哪个为准,可以给个明确的答案吗,谢谢

复现环境 Environment

  • os: cent os
  • paddlepaddle: 2.6.1
  • paddleDetection: release/2.6
  • python:3.8
  • cuda: 11.2
  • cudnn: 8.x

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
@zhangyubo0722
Copy link
Collaborator

检测模型基本上是基于8卡进行训练,如果使用默认配置的话,四卡训练则默认学习率除以2,单卡训练则默认学习率除以8

@stephen-TT
Copy link
Author

和batch_size有关系吗,比如说我修改了默认的batch_size, 使用4卡进行训练,学习率还是除以2吗

@zhangyubo0722
Copy link
Collaborator

是这样的,学习率根本上和总的batch_size有关系,在配置文件中的默认batch_size指的是单卡bs,假如设置的为4的话,并且在训练过程中使用八卡训的,所以总的bs为48=32,您自己训练的时候总的bs需要和学习率等比变化,例如您的是四卡,bs设置为2,那么总bs为42=8,相比于默认配置,总bs为之前的四分之一,所以学习率除以4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants