Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
c31931eb
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c31931eb
编写于
4月 26, 2021
作者:
L
lyuwenyu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ShuffleNet problem
上级
569215a2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
13 deletion
+11
-13
hubconf.py
hubconf.py
+11
-13
未找到文件。
hubconf.py
浏览文件 @
c31931eb
...
...
@@ -12,14 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
dependencies
=
[
'paddle'
,
'numpy'
]
import
paddle
from
ppcls.modeling.architectures
import
alexnet
as
_alexnet
from
ppcls.modeling.architectures
import
vgg
as
_vgg
from
ppcls.modeling.architectures
import
resnet
as
_resnet
from
ppcls.modeling.architectures
import
vgg
as
_vgg
from
ppcls.modeling.architectures
import
resnet
as
_resnet
from
ppcls.modeling.architectures
import
squeezenet
as
_squeezenet
from
ppcls.modeling.architectures
import
densenet
as
_densenet
from
ppcls.modeling.architectures
import
inception_v3
as
_inception_v3
...
...
@@ -32,13 +31,13 @@ from ppcls.modeling.architectures import mobilenet_v3 as _mobilenet_v3
from
ppcls.modeling.architectures
import
resnext
as
_resnext
def
_load_pretrained_parameters
(
model
,
name
):
url
=
'https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/{}_pretrained.pdparams'
.
format
(
name
)
url
=
'https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/{}_pretrained.pdparams'
.
format
(
name
)
path
=
paddle
.
utils
.
download
.
get_weights_path_from_url
(
url
)
model
.
set_state_dict
(
paddle
.
load
(
path
))
return
model
def
AlexNet
(
pretrained
=
False
,
**
kwargs
):
"""
...
...
@@ -182,7 +181,7 @@ def ResNet50(pretrained=False, **kwargs):
model
=
_resnet
.
ResNet50
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ResNet50'
)
return
model
...
...
@@ -404,19 +403,19 @@ def GoogLeNet(pretrained=False, **kwargs):
return
model
def
ShuffleNet
(
pretrained
=
False
,
**
kwargs
):
def
ShuffleNet
V2_x0_25
(
pretrained
=
False
,
**
kwargs
):
"""
ShuffleNet
ShuffleNet
V2_x0_25
Args:
pretrained: bool=False. If `True` load pretrained parameters, `False` otherwise.
kwargs:
class_dim: int=1000. Output dim of last fc layer.
Returns:
model: nn.Layer. Specific `ShuffleNet` model depends on args.
model: nn.Layer. Specific `ShuffleNet
V2_x0_25
` model depends on args.
"""
model
=
_shufflenet_v2
.
ShuffleNet
(
**
kwargs
)
model
=
_shufflenet_v2
.
ShuffleNet
V2_x0_25
(
**
kwargs
)
if
pretrained
:
model
=
_load_pretrained_parameters
(
model
,
'ShuffleNet'
)
model
=
_load_pretrained_parameters
(
model
,
'ShuffleNet
V2_x0_25
'
)
return
model
...
...
@@ -744,7 +743,6 @@ def MobileNetV3_small_x1_25(pretrained=False, **kwargs):
return
model
def
ResNeXt101_32x4d
(
pretrained
=
False
,
**
kwargs
):
"""
ResNeXt101_32x4d
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录