提交 1b004933 编写于 作者: D dongshuilong

fix resnet50_variant pretrained bugs

上级 77557082
from paddle.nn import Conv2D
from ppcls.arch.backbone.legendary_models.resnet import ResNet50
from ppcls.arch.backbone.legendary_models.resnet import ResNet50, MODEL_URLS, _load_pretrained
__all__ = ["ResNet50_last_stage_stride1"]
......@@ -17,6 +17,7 @@ def ResNet50_last_stage_stride1(pretrained=False, use_ssld=False, **kwargs):
return new_conv
match_re = "conv2d_4[4|6]"
model = ResNet50(pretrained=pretrained, use_ssld=use_ssld, **kwargs)
model = ResNet50(pretrained=False, use_ssld=use_ssld, **kwargs)
model.replace_sub(match_re, replace_function, True)
_load_pretrained(pretrained, model, MODEL_URLS["ResNet50"], use_ssld)
return model
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册