From 908563d060d3c7f2e46583e0e431ab5331f7e558 Mon Sep 17 00:00:00 2001 From: Shoufa Chen Date: Sun, 26 Sep 2021 12:32:22 +0800 Subject: [PATCH] fix `use_amp` Fix https://github.com/rwightman/pytorch-image-models/issues/881 --- train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/train.py b/train.py index 3943c7d0..84d8b2ea 100755 --- a/train.py +++ b/train.py @@ -397,7 +397,7 @@ def main(): # setup synchronized BatchNorm for distributed training if args.distributed and args.sync_bn: assert not args.split_bn - if has_apex and use_amp != 'native': + if has_apex and use_amp == 'apex': # Apex SyncBN preferred unless native amp is activated model = convert_syncbn_model(model) else: @@ -451,7 +451,7 @@ def main(): # setup distributed training if args.distributed: - if has_apex and use_amp != 'native': + if has_apex and use_amp == 'apex': # Apex DDP preferred unless native amp is activated if args.local_rank == 0: _logger.info("Using NVIDIA APEX DistributedDataParallel.")