Skip to content

Commit 3f9959c

Browse files
authored
Merge pull request #882 from ShoufaChen/master
fix `use_amp`
2 parents 3d9c23a + 908563d commit 3f9959c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

train.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def main():
397397
# setup synchronized BatchNorm for distributed training
398398
if args.distributed and args.sync_bn:
399399
assert not args.split_bn
400-
if has_apex and use_amp != 'native':
400+
if has_apex and use_amp == 'apex':
401401
# Apex SyncBN preferred unless native amp is activated
402402
model = convert_syncbn_model(model)
403403
else:
@@ -451,7 +451,7 @@ def main():
451451

452452
# setup distributed training
453453
if args.distributed:
454-
if has_apex and use_amp != 'native':
454+
if has_apex and use_amp == 'apex':
455455
# Apex DDP preferred unless native amp is activated
456456
if args.local_rank == 0:
457457
_logger.info("Using NVIDIA APEX DistributedDataParallel.")

0 commit comments

Comments
 (0)