From 0b96811611e984c5e59dec7c1c7939a74dadda2d Mon Sep 17 00:00:00 2001 From: James Betker Date: Fri, 13 Nov 2020 20:05:52 -0700 Subject: [PATCH] Fix another issue with gpu ids getting thrown all over hte place --- codes/models/steps/losses.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/models/steps/losses.py b/codes/models/steps/losses.py index 2b696834..c882bd7f 100644 --- a/codes/models/steps/losses.py +++ b/codes/models/steps/losses.py @@ -134,7 +134,7 @@ class FeatureLoss(ConfigurableLoss): self.netF = define_F(which_model=opt['which_model_F'], load_path=opt['load_path'] if 'load_path' in opt.keys() else None).to(self.env['device']) if not env['opt']['dist']: - self.netF = torch.nn.parallel.DataParallel(self.netF) + self.netF = torch.nn.parallel.DataParallel(self.netF, device_ids=env['opt']['gpu_ids']) def forward(self, _, state): with autocast(enabled=self.env['opt']['fp16']):