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 d462489 commit 8f84e1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,10 @@ def main():
logger.info(f'Config: {cfg.pretty_text}')

# set random seeds
seed = init_random_seed(args.seed, device=args.device,
distributed=distributed)
seed = seed + dist.get_rank() if args.diff_seed else seed
seed = init_random_seed(
args.seed, device=args.device, distributed=distributed)
if distributed:
seed = seed + dist.get_rank() if args.diff_seed else seed
logger.info(f'Set random seed to {seed}, '
f'deterministic: {args.deterministic}')
set_random_seed(seed, deterministic=args.deterministic)
Expand Down

0 comments on commit 8f84e1c

Please sign in to comment.