未验证 提交 6af48997 编写于 作者: G Guanghua Yu 提交者: GitHub

[cherry-pick] fix sync bn in cpu (#2826)

* fix sync_bn in cpu

* fix sync_bn in cpu
上级 34098ae4
......@@ -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')
......
......@@ -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')
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册