TRAILab / CaDDN

Categorical Depth Distribution Network for Monocular 3D Object Detection (CVPR 2021 Oral)
Apache License 2.0
359 stars 62 forks source link

When I train the model with 4 GPUs, should I set the sync_bn to true? #71

Closed rockywind closed 2 years ago

rockywind commented 2 years ago

Thank you for you help.

parser.add_argument('--sync_bn', action='store_true', default=False, help='whether to use sync bn')

codyreading commented 2 years ago

Yup, I set it as True when doing multi GPU training

rockywind commented 2 years ago

Thank you for your help! But,when I can't set the sync_bn as True, when I doing multi GPU inference.

codyreading commented 2 years ago

Yes, this only affects training, as this calculates the Batch Norm mean and variance across the full batch (all GPUs) when training. Inference these parameters are fixed, so you don't need to set anything there. Please see here

rockywind commented 2 years ago

Thank you very much!