diff --git a/advanced_source/neural_style_tutorial.py b/advanced_source/neural_style_tutorial.py index ee4dab7e7e..a293026cb5 100644 --- a/advanced_source/neural_style_tutorial.py +++ b/advanced_source/neural_style_tutorial.py @@ -56,7 +56,7 @@ import matplotlib.pyplot as plt import torchvision.transforms as transforms -import torchvision.models as models +from torchvision.models import vgg19, VGG19_Weights import copy @@ -262,7 +262,7 @@ def forward(self, input): # network to evaluation mode using ``.eval()``. # -cnn = models.vgg19(pretrained=True).features.eval() +cnn = vgg19(weights=VGG19_Weights.DEFAULT).features.eval()