Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ def setup(self, opt):

# Wrap networks with DDP after loading
if dist.is_initialized():
# Check if using syncbatch normalization for DDP
if self.opt.norm == "syncbatch":
raise ValueError(f"For distributed training, opt.norm must be 'syncbatch' or 'inst', but got '{self.opt.norm}'. " "Please set --norm syncbatch for multi-GPU training.")
# Check if using syncbatch or instance normalization for DDP
if self.opt.norm != "syncbatch" and self.opt.norm != "instance":
raise ValueError(f"For distributed training, opt.norm must be 'syncbatch' or 'instance', but got '{self.opt.norm}'. " "Please set --norm syncbatch for multi-GPU training.")

net = torch.nn.parallel.DistributedDataParallel(net, device_ids=[self.device.index])
# Sync all processes after DDP wrapping
Expand Down