Skip to content

Commit 47dd4bc

Browse files
Fix weight initialization on neural_style_tutorial (#2673)
Co-authored-by: Nicolas Hug <contact@nicolas-hug.com>
1 parent dc448c2 commit 47dd4bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

advanced_source/neural_style_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
import matplotlib.pyplot as plt
5757

5858
import torchvision.transforms as transforms
59-
import torchvision.models as models
59+
from torchvision.models import vgg19, VGG19_Weights
6060

6161
import copy
6262

@@ -262,7 +262,7 @@ def forward(self, input):
262262
# network to evaluation mode using ``.eval()``.
263263
#
264264

265-
cnn = models.vgg19(pretrained=True).features.eval()
265+
cnn = vgg19(weights=VGG19_Weights.DEFAULT).features.eval()
266266

267267

268268

0 commit comments

Comments
 (0)