Skip to content

Commit

Permalink
fix imagenet nondeterminism when seed is set (pytorch#1056) (pytorch#…
Browse files Browse the repository at this point in the history
  • Loading branch information
yzs981130 authored Sep 14, 2022
1 parent d5d9de6 commit 32c15f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion imagenet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def main():
random.seed(args.seed)
torch.manual_seed(args.seed)
cudnn.deterministic = True
cudnn.benchmark = False
warnings.warn('You have chosen to seed training. '
'This will turn on the CUDNN deterministic setting, '
'which can slow down your training considerably! '
Expand Down Expand Up @@ -204,7 +205,6 @@ def main_worker(gpu, ngpus_per_node, args):
else:
print("=> no checkpoint found at '{}'".format(args.resume))

cudnn.benchmark = True

# Data loading code
if args.dummy:
Expand Down

0 comments on commit 32c15f2

Please sign in to comment.