We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fa3046 commit b2a6586Copy full SHA for b2a6586
PaddleCV/PaddleDetection/tools/train.py
@@ -126,8 +126,9 @@ def main():
126
build_strategy.memory_optimize = False
127
build_strategy.enable_inplace = True
128
sync_bn = getattr(model.backbone, 'norm_type', None) == 'sync_bn'
129
- # only enable sync_bn in multi-devices
130
- build_strategy.sync_batch_norm = sync_bn and devices_num > 1
+ # only enable sync_bn in multi GPU devices
+ build_strategy.sync_batch_norm = sync_bn and devices_num > 1 \
131
+ and cfg.use_gpu
132
train_compile_program = fluid.compiler.CompiledProgram(
133
train_prog).with_data_parallel(
134
loss_name=loss.name, build_strategy=build_strategy)
0 commit comments