Skip to content

Commit 32c15f2

Browse files
authored
fix imagenet nondeterminism when seed is set (#1056) (#1057)
1 parent d5d9de6 commit 32c15f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

imagenet/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def main():
8888
random.seed(args.seed)
8989
torch.manual_seed(args.seed)
9090
cudnn.deterministic = True
91+
cudnn.benchmark = False
9192
warnings.warn('You have chosen to seed training. '
9293
'This will turn on the CUDNN deterministic setting, '
9394
'which can slow down your training considerably! '
@@ -204,7 +205,6 @@ def main_worker(gpu, ngpus_per_node, args):
204205
else:
205206
print("=> no checkpoint found at '{}'".format(args.resume))
206207

207-
cudnn.benchmark = True
208208

209209
# Data loading code
210210
if args.dummy:

0 commit comments

Comments
 (0)