def SyncBatchNorm(*args, **kwargs):
    """In cpu environment nn.SyncBatchNorm does not have kernel so use nn.BatchNorm2D instead"""
    if paddle.get_device() == 'cpu' or os.environ.get(
            'PADDLESEG_EXPORT_STAGE') or 'xpu' in paddle.get_device():
        return nn.BatchNorm2D(*args, **kwargs)
    elif paddle.distributed.ParallelEnv().nranks == 1:
        return nn.BatchNorm2D(*args, **kwargs)
    elif 'npu' in paddle.get_device() or 'mlu' in paddle.get_device():
        return NaiveSyncBatchNorm(*args, **kwargs)
    else:
        return nn.SyncBatchNorm(*args, **kwargs)
In cpu environment nn.SyncBatchNorm does not have kernel so use nn.BatchNorm2D instead
paddleseg/models/layers/layer_libs.py