From ccd15f519002f6dc68f901e6a5fd00efbd5050b5 Mon Sep 17 00:00:00 2001 From: gaotingquan Date: Thu, 14 Apr 2022 08:19:39 +0000 Subject: [PATCH] uncommit: sync bn is too slow to use and convert_sync_batchnorm() is not effective for BatchNorm --- ppcls/engine/engine.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ppcls/engine/engine.py b/ppcls/engine/engine.py index 1dcf6535..019cf165 100644 --- a/ppcls/engine/engine.py +++ b/ppcls/engine/engine.py @@ -243,11 +243,6 @@ class Engine(object): level=amp_level, save_dtype='float32') - # TODO(gaotingquan): convert_sync_batchnorm is not effective - # eval loss in training is inconsistent with the eval only if bn is used, - # because the running_mean and running_var of bn are not synced in dist. - self.model = nn.SyncBatchNorm.convert_sync_batchnorm(self.model) - # for distributed world_size = dist.get_world_size() self.config["Global"]["distributed"] = world_size != 1 -- GitLab