File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
fast_neural_style/neural_style Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change 55from torchvision import models
66
77# Download and load the pre-trained model
8- model = models .resnet18 (pretrained = True )
8+ model = models .resnet18 (weights = models . ResNet18_Weights . IMAGENET1K_V1 )
99
1010# Set upgrading the gradients to False
1111for param in model .parameters ():
Original file line number Diff line number Diff line change 77class Vgg16 (torch .nn .Module ):
88 def __init__ (self , requires_grad = False ):
99 super (Vgg16 , self ).__init__ ()
10- vgg_pretrained_features = models .vgg16 (pretrained = True ).features
10+ vgg_pretrained_features = models .vgg16 (weights = models . VGG16_Weights . IMAGENET1K_V1 ).features
1111 self .slice1 = torch .nn .Sequential ()
1212 self .slice2 = torch .nn .Sequential ()
1313 self .slice3 = torch .nn .Sequential ()
You can’t perform that action at this time.
0 commit comments