Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
0b037696
P
PaddleSeg
项目概览
PaddlePaddle
/
PaddleSeg
通知
285
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0b037696
编写于
9月 23, 2020
作者:
M
michaelowenliu
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/PaddleSeg
into develop
上级
c21f8226
c707f0e4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
12 addition
and
20 deletion
+12
-20
dygraph/paddleseg/models/backbones/hrnet.py
dygraph/paddleseg/models/backbones/hrnet.py
+6
-10
dygraph/paddleseg/models/fcn.py
dygraph/paddleseg/models/fcn.py
+6
-10
未找到文件。
dygraph/paddleseg/models/backbones/hrnet.py
浏览文件 @
0b037696
...
@@ -174,16 +174,12 @@ class HRNet(nn.Layer):
...
@@ -174,16 +174,12 @@ class HRNet(nn.Layer):
return
[
x
]
return
[
x
]
def
init_weight
(
self
):
def
init_weight
(
self
):
params
=
self
.
parameters
()
for
layer
in
self
.
sublayers
():
for
param
in
params
:
if
isinstance
(
layer
,
nn
.
Conv2d
):
param_name
=
param
.
name
param_init
.
normal_init
(
layer
.
weight
,
scale
=
0.001
)
if
'batch_norm'
in
param_name
:
elif
isinstance
(
layer
,
(
nn
.
BatchNorm
,
nn
.
SyncBatchNorm
)):
if
'w_0'
in
param_name
:
param_init
.
constant_init
(
layer
.
weight
,
value
=
1.0
)
param_init
.
constant_init
(
param
,
value
=
1.0
)
param_init
.
constant_init
(
layer
.
bias
,
value
=
0.0
)
elif
'b_0'
in
param_name
:
param_init
.
constant_init
(
param
,
value
=
0.0
)
if
'conv'
in
param_name
and
'w_0'
in
param_name
:
param_init
.
normal_init
(
param
,
scale
=
0.001
)
if
self
.
pretrained
is
not
None
:
if
self
.
pretrained
is
not
None
:
utils
.
load_pretrained_model
(
self
,
self
.
pretrained
)
utils
.
load_pretrained_model
(
self
,
self
.
pretrained
)
...
...
dygraph/paddleseg/models/fcn.py
浏览文件 @
0b037696
...
@@ -110,16 +110,12 @@ class FCNHead(nn.Layer):
...
@@ -110,16 +110,12 @@ class FCNHead(nn.Layer):
return
logit_list
return
logit_list
def
init_weight
(
self
):
def
init_weight
(
self
):
params
=
self
.
parameters
()
for
layer
in
self
.
sublayers
():
for
param
in
params
:
if
isinstance
(
layer
,
nn
.
Conv2d
):
param_name
=
param
.
name
param_init
.
normal_init
(
layer
.
weight
,
scale
=
0.001
)
if
'batch_norm'
in
param_name
:
elif
isinstance
(
layer
,
(
nn
.
BatchNorm
,
nn
.
SyncBatchNorm
)):
if
'w_0'
in
param_name
:
param_init
.
constant_init
(
layer
.
weight
,
value
=
1.0
)
param_init
.
constant_init
(
param
,
value
=
1.0
)
param_init
.
constant_init
(
layer
.
bias
,
value
=
0.0
)
elif
'b_0'
in
param_name
:
param_init
.
constant_init
(
param
,
value
=
0.0
)
if
'conv'
in
param_name
and
'w_0'
in
param_name
:
param_init
.
normal_init
(
param
,
scale
=
0.001
)
@
manager
.
MODELS
.
add_component
@
manager
.
MODELS
.
add_component
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录