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

[Fix] Fix random seed #600

Merged
merged 1 commit into from
Nov 18, 2021
Merged

Conversation

gaotongxiao
Copy link
Collaborator

Motivation

The previous implementation did not always force all the processes to have the same random seed in DDP training, which may lead to inconsistent results across different runs. This PR fixes this issue by always broadcasting a random seed to all the processes during the training initialization phase.

Reference

open-mmlab/mmdetection#6457

@codecov
Copy link

codecov bot commented Nov 18, 2021

Codecov Report

Merging #600 (0e97f2c) into main (284b5ac) will increase coverage by 0.00%.
The diff coverage is 21.42%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #600   +/-   ##
=======================================
  Coverage   84.86%   84.86%           
=======================================
  Files         143      143           
  Lines        9802     9816   +14     
  Branches     1417     1420    +3     
=======================================
+ Hits         8318     8330   +12     
- Misses       1157     1158    +1     
- Partials      327      328    +1     
Flag Coverage Δ
unittests 84.86% <21.42%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmocr/apis/train.py 16.66% <21.42%> (+1.04%) ⬆️
mmocr/datasets/pipelines/transforms.py 83.99% <0.00%> (+1.48%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 284b5ac...0e97f2c. Read the comment docs.

@gaotongxiao gaotongxiao merged commit e267d06 into open-mmlab:main Nov 18, 2021
@gaotongxiao gaotongxiao deleted the fix_random_seed branch November 18, 2021 14:26
gaotongxiao added a commit to gaotongxiao/mmocr that referenced this pull request Jul 15, 2022
gaotongxiao added a commit to gaotongxiao/mmocr that referenced this pull request Jul 15, 2022
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

Successfully merging this pull request may close these issues.

2 participants