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

RuntimeError: you can only change requires_grad flags of leaf variables. #3

Open
Bear-kai opened this issue Oct 17, 2019 · 1 comment

Comments

@Bear-kai
Copy link

"item.weight.requires_grad = True" of the forward function of class BlockA, BlockB and BlockC will cause the above error. I found it is caused by the use of DataParallel of the model. So how to train with multiple gpus?

@liuyuisanai
Copy link
Owner

Hi @Bear-kai , this code is a converted version of the original one and just for inference. We implement the parallel training with an internal library, similar to the distributed data parallel in PyTorch.

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

2 participants