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

the necessity of data_dependent_initialize #21

Closed
Turlan opened this issue Sep 9, 2020 · 2 comments
Closed

the necessity of data_dependent_initialize #21

Turlan opened this issue Sep 9, 2020 · 2 comments

Comments

@Turlan
Copy link

Turlan commented Sep 9, 2020

Hi, great work! Thanks for releasing codes. I am confused about the data_dependent_initialize step. Could you explain why we need this extra step before the real training starts?

model.data_dependent_initialize()

@QtacierP
Copy link

QtacierP commented Sep 9, 2020

If you do not set this function, you will get some troubles when you use multiple GPUs. The MLP flag will be initialized and fixed when you use the nn.DataParallel() to replace the naive model (nn.Module). Therefore, we need to initialize the MLP before we parallelize the model

@Turlan Turlan closed this as completed Sep 10, 2020
@ibro45
Copy link

ibro45 commented Dec 18, 2020

@QtacierP does that imply that there's no other purpose to it except that it's patching the issue with nn.DataParallel() and that if nn.DataParallel() is not used, it'd be safe to remove it?

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