InplaceABN库只支持版本小于1.0.0的torch
#code is from https://sourcegraph.com/github.com/HRNet/HRNet-Semantic-#
Segmentation/-/blob/lib/models/bn_helper.py
if torch.__version__.startswith('0'):
from .sync_bn.inplace_abn.bn import InPlaceABNSync
BatchNorm2d = functools.partial(InPlaceABNSync, activation='none')
BatchNorm2d_class = InPlaceABNSync
relu_inplace = False
else:
print('Beacuse torch.__version__.startswith("0")=False, so you could not ues
inplace_abn.bn')
BatchNorm2d_class = BatchNorm2d = torch.nn.SyncBatchNorm
relu_inplace = True



