diff --git a/adaptis/utils/args.py b/adaptis/utils/args.py index 830e449..d56ed7a 100644 --- a/adaptis/utils/args.py +++ b/adaptis/utils/args.py @@ -11,9 +11,6 @@ def get_common_arguments(): parser.add_argument('--thread-pool', action='store_true', default=False, help='use ThreadPool for dataloader workers') - parser.add_argument('--no-cuda', action='store_true', default=False, - help='disables CUDA training') - parser.add_argument('--ngpus', type=int, default=len(mx.test_utils.list_gpus()), help='number of GPUs') diff --git a/adaptis/utils/exp.py b/adaptis/utils/exp.py index e07c612..a925364 100644 --- a/adaptis/utils/exp.py +++ b/adaptis/utils/exp.py @@ -46,20 +46,15 @@ def init_experiment(experiment_name, add_exp_args, script_path=None): fh.setFormatter(formatter) logger.addHandler(fh) - if args.no_cuda: - logger.info('Using CPU') - args.kvstore = 'local' - args.ctx = mx.cpu(0) + if args.gpus: + args.ctx = [mx.gpu(int(i)) for i in args.gpus.split(',')] + args.ngpus = len(args.ctx) else: - if args.gpus: - args.ctx = [mx.gpu(int(i)) for i in args.gpus.split(',')] - args.ngpus = len(args.ctx) - else: - args.ctx = [mx.gpu(i) for i in range(args.ngpus)] - logger.info(f'Number of GPUs: {args.ngpus}') - - if args.ngpus < 2: - args.syncbn = False + args.ctx = [mx.gpu(i) for i in range(args.ngpus)] + logger.info(f'Number of GPUs: {args.ngpus}') + + if args.ngpus < 2: + args.syncbn = False logger.info(args)