We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cead596 commit c67bbabCopy full SHA for c67bbab
cpp/transfer-learning/convert.py
@@ -5,7 +5,7 @@
5
from torchvision import models
6
7
# Download and load the pre-trained model
8
-model = models.resnet18(pretrained=True)
+model = models.resnet18(weights=models.ResNet18_Weights.IMAGENET1K_V1)
9
10
# Set upgrading the gradients to False
11
for param in model.parameters():
fast_neural_style/neural_style/vgg.py
@@ -7,7 +7,7 @@
class Vgg16(torch.nn.Module):
def __init__(self, requires_grad=False):
super(Vgg16, self).__init__()
- vgg_pretrained_features = models.vgg16(pretrained=True).features
+ vgg_pretrained_features = models.vgg16(weights=models.VGG16_Weights.IMAGENET1K_V1).features
self.slice1 = torch.nn.Sequential()
12
self.slice2 = torch.nn.Sequential()
13
self.slice3 = torch.nn.Sequential()
0 commit comments