Skip to content

Commit

Permalink
update deprecated VGG parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Khoa D. Vo committed Sep 5, 2022
1 parent 651835a commit 5a345c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions basicsr/archs/vgg_arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ def __init__(self,
max_idx = idx

if os.path.exists(VGG_PRETRAIN_PATH):
vgg_net = getattr(vgg, vgg_type)(pretrained=False)
vgg_net = getattr(vgg, vgg_type)(weights=None)
state_dict = torch.load(VGG_PRETRAIN_PATH, map_location=lambda storage, loc: storage)
vgg_net.load_state_dict(state_dict)
else:
vgg_net = getattr(vgg, vgg_type)(pretrained=True)
vgg_net = getattr(vgg, vgg_type)(weights=vgg.VGG19_Weights.DEFAULT)

features = vgg_net.features[:max_idx + 1]

Expand Down

0 comments on commit 5a345c1

Please sign in to comment.