trojans-face-recognizer icon indicating copy to clipboard operation
trojans-face-recognizer copied to clipboard

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

Open Bear-kai opened this issue 5 years ago • 1 comments

"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?

Bear-kai avatar Oct 17 '19 08:10 Bear-kai