Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
db8a896f
P
PaddleSeg
项目概览
PaddlePaddle
/
PaddleSeg
通知
286
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看板
提交
db8a896f
编写于
10月 30, 2019
作者:
W
wuzewu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete redundant code
上级
6d7433dd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
18 deletion
+0
-18
pdseg/models/backbone/xception.py
pdseg/models/backbone/xception.py
+0
-18
未找到文件。
pdseg/models/backbone/xception.py
浏览文件 @
db8a896f
...
...
@@ -150,13 +150,11 @@ class Xception():
chns
=
self
.
bottleneck_params
[
"entry_flow"
][
2
]
strides
=
check_data
(
strides
,
block_num
)
chns
=
check_data
(
chns
,
block_num
)
#print("entry:", block_num, strides, chns)
# params to control your flow
s
=
self
.
stride
block_point
=
self
.
block_point
output_stride
=
self
.
output_stride
#print("entry:", s, block_point, output_stride)
with
scope
(
"entry_flow"
):
for
i
in
range
(
block_num
):
block_point
=
block_point
+
1
...
...
@@ -167,13 +165,10 @@ class Xception():
data
,
chns
[
i
],
[
1
,
1
,
stride
])
s
=
s
*
stride
if
check_points
(
block_point
,
self
.
decode_points
):
#print("decode shortcut:", block_point)
self
.
short_cuts
[
block_point
]
=
short_cuts
[
1
]
#print("entry:", i, data.shape)
self
.
stride
=
s
self
.
block_point
=
block_point
#print("entry:", s, block_point, output_stride)
return
data
def
middle_flow
(
self
,
data
):
...
...
@@ -183,12 +178,10 @@ class Xception():
strides
=
check_data
(
strides
,
block_num
)
chns
=
check_data
(
chns
,
block_num
)
#print("middle:", block_num, strides, chns)
# params to control your flow
s
=
self
.
stride
block_point
=
self
.
block_point
output_stride
=
self
.
output_stride
#print("middle:", s, block_point, output_stride)
with
scope
(
"middle_flow"
):
for
i
in
range
(
block_num
):
block_point
=
block_point
+
1
...
...
@@ -199,13 +192,10 @@ class Xception():
data
,
chns
[
i
],
[
1
,
1
,
strides
[
i
]],
skip_conv
=
False
)
s
=
s
*
stride
if
check_points
(
block_point
,
self
.
decode_points
):
#print("decode shortcut:", block_point)
self
.
short_cuts
[
block_point
]
=
short_cuts
[
1
]
#print("middle:", i, data.shape)
self
.
stride
=
s
self
.
block_point
=
block_point
#print("middle:", s, block_point, output_stride)
return
data
def
exit_flow
(
self
,
data
):
...
...
@@ -214,14 +204,12 @@ class Xception():
chns
=
self
.
bottleneck_params
[
"exit_flow"
][
2
]
strides
=
check_data
(
strides
,
block_num
)
chns
=
check_data
(
chns
,
block_num
)
#print("exit:", block_num, strides, chns)
assert
(
block_num
==
2
)
# params to control your flow
s
=
self
.
stride
block_point
=
self
.
block_point
output_stride
=
self
.
output_stride
#print("exit:", s, block_point, output_stride)
with
scope
(
"exit_flow"
):
with
scope
(
'block1'
):
block_point
+=
1
...
...
@@ -231,9 +219,7 @@ class Xception():
[
1
,
1
,
stride
])
s
=
s
*
stride
if
check_points
(
block_point
,
self
.
decode_points
):
#print("decode shortcut:", block_point)
self
.
short_cuts
[
block_point
]
=
short_cuts
[
1
]
#print("exit:", 0, data.shape)
with
scope
(
'block2'
):
block_point
+=
1
stride
=
strides
[
1
]
if
check_stride
(
s
*
strides
[
1
],
...
...
@@ -246,13 +232,10 @@ class Xception():
activation_fn_in_separable_conv
=
True
)
s
=
s
*
stride
if
check_points
(
block_point
,
self
.
decode_points
):
#print("decode shortcut:", block_point)
self
.
short_cuts
[
block_point
]
=
short_cuts
[
1
]
#print("exit:", 1, data.shape)
self
.
stride
=
s
self
.
block_point
=
block_point
#print("exit:", s, block_point, output_stride)
return
data
def
xception_block
(
self
,
...
...
@@ -332,4 +315,3 @@ if __name__ == '__main__':
image
=
fluid
.
layers
.
data
(
name
=
'image'
,
shape
=
image_shape
,
dtype
=
'float32'
)
model
=
xception_65
()
logit
=
model
.
net
(
image
)
#print("logit:", logit.shape)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录