Update build.py

训练过程中,内存一直增长,到后期会把整个服务器的内存都占完,初步分析将上述两个增强关闭后,内存使用会正常,具体是因为哪个方法,因为哪个实现有问题,暂时还没有时间分析
This commit is contained in:
rrjia 2022-07-28 17:48:27 +08:00 committed by GitHub
parent 4508251d74
commit 9b656c3da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -80,13 +80,13 @@ def build_transforms(cfg, is_train=True):
if do_affine: if do_affine:
res.append(T.RandomAffine(degrees=10, translate=None, scale=[0.9, 1.1], shear=0.1, resample=False, res.append(T.RandomAffine(degrees=10, translate=None, scale=[0.9, 1.1], shear=0.1, resample=False,
fillcolor=0)) fillcolor=0))
if do_augmix: # if do_augmix:
res.append(AugMix(prob=augmix_prob)) # res.append(AugMix(prob=augmix_prob))
res.append(ToTensor()) res.append(ToTensor())
if do_rea: if do_rea:
res.append(T.RandomErasing(p=rea_prob, value=rea_value)) res.append(T.RandomErasing(p=rea_prob, value=rea_value))
if do_rpt: # if do_rpt:
res.append(RandomPatch(prob_happen=rpt_prob)) # res.append(RandomPatch(prob_happen=rpt_prob))
else: else:
size_test = cfg.INPUT.SIZE_TEST size_test = cfg.INPUT.SIZE_TEST
do_crop = cfg.INPUT.CROP.ENABLED do_crop = cfg.INPUT.CROP.ENABLED