Skip to content

Commit 0a6eb82

Browse files
set cudnn.benchmark to True for speed up training process (#1811)
set cudnn.benchmark to True for speed up training process Co-authored-by: Brian Johnson <brianjo@fb.com>
1 parent 237311d commit 0a6eb82

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

beginner_source/transfer_learning_tutorial.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import torch.nn as nn
4040
import torch.optim as optim
4141
from torch.optim import lr_scheduler
42+
import torch.backends.cudnn as cudnn
4243
import numpy as np
4344
import torchvision
4445
from torchvision import datasets, models, transforms
@@ -47,6 +48,7 @@
4748
import os
4849
import copy
4950

51+
cudnn.benchmark = True
5052
plt.ion() # interactive mode
5153

5254
######################################################################

0 commit comments

Comments
 (0)