diff --git a/tools/eval.py b/tools/eval.py index 65080e90e8880233646ea0d3b8c73def183653aa..5df7a07745b86009b02f34f81edb27a81bed7822 100755 --- a/tools/eval.py +++ b/tools/eval.py @@ -117,6 +117,9 @@ def main(): place = paddle.set_device('gpu' if cfg.use_gpu else 'cpu') + if 'norm_type' in cfg and cfg['norm_type'] == 'sync_bn' and not cfg.use_gpu: + cfg['norm_type'] = 'bn' + if FLAGS.slim_config: cfg = build_slim_model(cfg, FLAGS.slim_config, mode='eval') diff --git a/tools/infer.py b/tools/infer.py index d4f213ead51a73915787726662d4c0c13980d07b..7ea0d2353a2472127e5cbfeb07c63f66d88f2830 100755 --- a/tools/infer.py +++ b/tools/infer.py @@ -141,6 +141,9 @@ def main(): place = paddle.set_device('gpu' if cfg.use_gpu else 'cpu') + if 'norm_type' in cfg and cfg['norm_type'] == 'sync_bn' and not cfg.use_gpu: + cfg['norm_type'] = 'bn' + if FLAGS.slim_config: cfg = build_slim_model(cfg, FLAGS.slim_config, mode='test') diff --git a/tools/train.py b/tools/train.py index b0c49966e574de920ee7465304a7e681c937447c..d9ef6d6f24d89d6322b6ecd01d358049386af971 100755 --- a/tools/train.py +++ b/tools/train.py @@ -123,6 +123,9 @@ def main(): place = paddle.set_device('gpu' if cfg.use_gpu else 'cpu') + if 'norm_type' in cfg and cfg['norm_type'] == 'sync_bn' and not cfg.use_gpu: + cfg['norm_type'] = 'bn' + if FLAGS.slim_config: cfg = build_slim_model(cfg, FLAGS.slim_config)