Skip to content

Commit

Permalink
imporve cpu training/testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamerlin committed Mar 10, 2022
1 parent 6228ccd commit b5df1ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,16 @@ def main():
'Non-distributed training can only use 1 gpu now. We will '
'use the 1st one in gpu_ids. ')
cfg.gpu_ids = [args.gpu_ids[0]]
elif args.gpus is not None:
else:
warnings.warn('Non-distributed training can only use 1 gpu now. ')
cfg.gpu_ids = range(1)

if args.gpus is None and args.gpu_ids is None:
cfg.gpu_ids = range(1)

if args.device == 'cpu':
cfg.gpu_ids = range(1)

# init distributed env first, since logger depends on the dist info.
if args.launcher == 'none':
distributed = False
Expand Down

0 comments on commit b5df1ce

Please sign in to comment.