Minor typo bug when checking normalization choice for DDP training

Author: huhumanCreated Nov 10, 2025Updated Nov 11, 2025

Thanks for the work for supporting DDP training. I noticed a likely bug when checking normalization choice for DDP:

python
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.")

which can be found https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/2a7afba2895d52556dd5dfe07e8555ef657ced6f/models/base_model.py#L118C21-L119C193

A quick fix can be

python
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.")

The codes work for me under multi-GPU DDP after this minor revision.

Source: junyanz/pytorch-CycleGAN-and-pix2pix