Skip to content

Commit

Permalink
fixed backbone bug (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjj19950828 authored Oct 14, 2021
1 parent 7220d93 commit 9ca4f40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x2paddle/project_convertor/pytorch/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def _resnet(arch: str,
**kwargs: Any) -> ResNet:
model = ResNet(block, layers, **kwargs)
if pretrained:
state_dict = get_weights_path_from_url(model_urls[arch])
state_dict = paddle.load(get_weights_path_from_url(model_urls[arch]))
model.load_dict(state_dict)
return model

Expand Down
2 changes: 1 addition & 1 deletion x2paddle/project_convertor/pytorch/models/vgg.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _vgg(arch: str, cfg: str, batch_norm: bool, pretrained: bool,
kwargs['init_weights'] = False
model = VGG(make_layers(cfgs[cfg], batch_norm=batch_norm), **kwargs)
if pretrained:
state_dict = get_weights_path_from_url(model_urls[arch])
state_dict = paddle.load(get_weights_path_from_url(model_urls[arch]))
model.load_dict(state_dict)
return model

Expand Down

0 comments on commit 9ca4f40

Please sign in to comment.