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

erro in multi-GPU training #7

Open
wytcsuch opened this issue Sep 24, 2020 · 1 comment
Open

erro in multi-GPU training #7

wytcsuch opened this issue Sep 24, 2020 · 1 comment

Comments

@wytcsuch
Copy link

wytcsuch commented Sep 24, 2020

when I train with multiply GPU,an erro occur:
File "/wytdata/Real-SR/codes/models/SRGAN_model.py", line 74, in __init__ model = create_model(opt) File "/wytdata/Real-SR/codes/models/__init__.py", line 14, in create_model m = M(opt) File "/wytdata/Real-SR/codes/models/SRGAN_model.py", line 74, in __init__ device_ids=[torch.cuda.current_device()]) File "/opt/conda/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 238, in __init__ device_ids=[torch.cuda.current_device()]) File "/opt/conda/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 238, in __init__ "DistributedDataParallel is not needed when a module " AssertionError: DistributedDataParallel is not needed when a module doesn't have any parameter that requires a gradient. "DistributedDataParallel is not needed when a module " AssertionError: DistributedDataParallel is not needed when a module doesn't have any parameter that requires a gradient.

The cause of the error appears to be to stop updating the parameters of VGG,Is there any solution?
if self.cri_fea: # load VGG perceptual loss
self.netF = networks.define_F(opt, use_bn=False).to(self.device)
if opt['dist']:
self.netF = DistributedDataParallel(self.netF,device_ids=[torch.cuda.current_device()]) #erro occurs here
else:
self.netF = DataParallel(self.netF)

@Jinbo-Hu
Copy link

Jinbo-Hu commented Nov 1, 2021

Do you solve this problem? I also have the same issue.

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