diff --git a/configs/cyclegan_cityscapes.yaml b/configs/cyclegan_cityscapes.yaml index 4f5257bb6108d2c7191e84356b49e21796790704..e6265361368a55fb9084e9952da8dbe82c2189b7 100644 --- a/configs/cyclegan_cityscapes.yaml +++ b/configs/cyclegan_cityscapes.yaml @@ -1,5 +1,6 @@ epochs: 200 output_dir: output_dir +find_unused_parameters: True model: name: CycleGANModel diff --git a/configs/cyclegan_horse2zebra.yaml b/configs/cyclegan_horse2zebra.yaml index 15e449e7607791794cdc9448025f0c62d6f041b1..7d831fff6c60fab4e55a581dbc20803c5b9400a6 100644 --- a/configs/cyclegan_horse2zebra.yaml +++ b/configs/cyclegan_horse2zebra.yaml @@ -1,5 +1,6 @@ epochs: 200 output_dir: output_dir +find_unused_parameters: True model: name: CycleGANModel diff --git a/configs/esrgan_x4_div2k.yaml b/configs/esrgan_x4_div2k.yaml index 90469ec4ef0c7415c9dcf1feab57a99f29ee4f6e..e09036a6c7532195cc2d4613c449298580e9d490 100644 --- a/configs/esrgan_x4_div2k.yaml +++ b/configs/esrgan_x4_div2k.yaml @@ -1,5 +1,6 @@ total_iters: 250000 output_dir: output_dir +find_unused_parameters: True # tensor range for function tensor2img min_max: (0., 1.) diff --git a/configs/makeup.yaml b/configs/makeup.yaml index 1d68f52ef3751ed55ef4f31e2d92b37eefaa7a90..05723e02b4c96c460e18affbb8774b36c5c6b532 100644 --- a/configs/makeup.yaml +++ b/configs/makeup.yaml @@ -1,6 +1,7 @@ epochs: 100 output_dir: tmp checkpoints_dir: checkpoints +find_unused_parameters: True model: name: MakeupModel diff --git a/configs/realsr_bicubic_noise_x4_df2k.yaml b/configs/realsr_bicubic_noise_x4_df2k.yaml index 95de7fbad96b26831ecb4fe0a3b5b8bad6ecc2e2..6200825716fe4db5bedf4b77efe204a7e995d80d 100644 --- a/configs/realsr_bicubic_noise_x4_df2k.yaml +++ b/configs/realsr_bicubic_noise_x4_df2k.yaml @@ -1,5 +1,6 @@ total_iters: 60000 output_dir: output_dir +find_unused_parameters: True # tensor range for function tensor2img min_max: (0., 1.) diff --git a/configs/realsr_kernel_noise_x4_dped.yaml b/configs/realsr_kernel_noise_x4_dped.yaml index 9322d97eb8ee9fc26c3b250217681ea7e160690c..c2e6eabf618f7dfcf9c009649317f4947e25218a 100644 --- a/configs/realsr_kernel_noise_x4_dped.yaml +++ b/configs/realsr_kernel_noise_x4_dped.yaml @@ -1,5 +1,6 @@ total_iters: 60000 output_dir: output_dir +find_unused_parameters: True # tensor range for function tensor2img min_max: (0., 1.) diff --git a/ppgan/engine/trainer.py b/ppgan/engine/trainer.py index e734f84e5d5ba8a6560e3dedc2aa7993fa8a561b..b49b8fc05c152afc3c5aa06112e622b548975047 100755 --- a/ppgan/engine/trainer.py +++ b/ppgan/engine/trainer.py @@ -146,8 +146,10 @@ class Trainer: def distributed_data_parallel(self): paddle.distributed.init_parallel_env() + find_unused_parameters = self.cfg.get('find_unused_parameters', False) for net_name, net in self.model.nets.items(): - self.model.nets[net_name] = paddle.DataParallel(net) + self.model.nets[net_name] = paddle.DataParallel( + net, find_unused_parameters=find_unused_parameters) def learning_rate_scheduler_step(self): if isinstance(self.model.lr_scheduler, dict):