Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
8dd6418a
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
1 年多 前同步成功
通知
116
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看板
未验证
提交
8dd6418a
编写于
12月 26, 2020
作者:
L
littletomatodonkey
提交者:
GitHub
12月 26, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix reshape to flatten (#513)
* fix reshape to flatten * fix reshape
上级
b401e10b
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
8 addition
and
10 deletion
+8
-10
ppcls/modeling/architectures/densenet.py
ppcls/modeling/architectures/densenet.py
+1
-1
ppcls/modeling/architectures/dpn.py
ppcls/modeling/architectures/dpn.py
+1
-1
ppcls/modeling/architectures/mobilenet_v1.py
ppcls/modeling/architectures/mobilenet_v1.py
+1
-1
ppcls/modeling/architectures/mobilenet_v2.py
ppcls/modeling/architectures/mobilenet_v2.py
+1
-1
ppcls/modeling/architectures/mobilenet_v3.py
ppcls/modeling/architectures/mobilenet_v3.py
+1
-1
ppcls/modeling/architectures/shufflenet_v2.py
ppcls/modeling/architectures/shufflenet_v2.py
+1
-1
ppcls/modeling/architectures/vgg.py
ppcls/modeling/architectures/vgg.py
+1
-3
ppcls/modeling/architectures/xception.py
ppcls/modeling/architectures/xception.py
+1
-1
未找到文件。
ppcls/modeling/architectures/densenet.py
浏览文件 @
8dd6418a
...
...
@@ -278,7 +278,7 @@ class DenseNet(nn.Layer):
conv
=
self
.
batch_norm
(
conv
)
y
=
self
.
pool2d_avg
(
conv
)
y
=
paddle
.
reshape
(
y
,
shape
=
[
-
1
,
y
.
shape
[
1
]]
)
y
=
paddle
.
flatten
(
y
,
start_axis
=
1
,
stop_axis
=-
1
)
y
=
self
.
out
(
y
)
return
y
...
...
ppcls/modeling/architectures/dpn.py
浏览文件 @
8dd6418a
...
...
@@ -328,7 +328,7 @@ class DPN(nn.Layer):
conv5_x_x
=
self
.
conv5_x_x_bn
(
conv5_x_x
)
y
=
self
.
pool2d_avg
(
conv5_x_x
)
y
=
paddle
.
reshape
(
y
,
shape
=
[
0
,
-
1
]
)
y
=
paddle
.
flatten
(
y
,
start_axis
=
1
,
stop_axis
=-
1
)
y
=
self
.
out
(
y
)
return
y
...
...
ppcls/modeling/architectures/mobilenet_v1.py
浏览文件 @
8dd6418a
...
...
@@ -241,7 +241,7 @@ class MobileNet(nn.Layer):
for
block
in
self
.
block_list
:
y
=
block
(
y
)
y
=
self
.
pool2d_avg
(
y
)
y
=
paddle
.
reshape
(
y
,
shape
=
[
-
1
,
int
(
1024
*
self
.
scale
)]
)
y
=
paddle
.
flatten
(
y
,
start_axis
=
1
,
stop_axis
=-
1
)
y
=
self
.
out
(
y
)
return
y
...
...
ppcls/modeling/architectures/mobilenet_v2.py
浏览文件 @
8dd6418a
...
...
@@ -213,7 +213,7 @@ class MobileNet(nn.Layer):
y
=
block
(
y
)
y
=
self
.
conv9
(
y
,
if_act
=
True
)
y
=
self
.
pool2d_avg
(
y
)
y
=
paddle
.
reshape
(
y
,
shape
=
[
-
1
,
self
.
out_c
]
)
y
=
paddle
.
flatten
(
y
,
start_axis
=
1
,
stop_axis
=-
1
)
y
=
self
.
out
(
y
)
return
y
...
...
ppcls/modeling/architectures/mobilenet_v3.py
浏览文件 @
8dd6418a
...
...
@@ -169,7 +169,7 @@ class MobileNetV3(nn.Layer):
x
=
self
.
last_conv
(
x
)
x
=
hard_swish
(
x
)
x
=
self
.
dropout
(
x
)
x
=
paddle
.
reshape
(
x
,
shape
=
[
x
.
shape
[
0
],
x
.
shape
[
1
]]
)
x
=
paddle
.
flatten
(
x
,
start_axis
=
1
,
stop_axis
=-
1
)
x
=
self
.
out
(
x
)
return
x
...
...
ppcls/modeling/architectures/shufflenet_v2.py
浏览文件 @
8dd6418a
...
...
@@ -279,7 +279,7 @@ class ShuffleNet(Layer):
y
=
inv
(
y
)
y
=
self
.
_last_conv
(
y
)
y
=
self
.
_pool2d_avg
(
y
)
y
=
reshape
(
y
,
shape
=
[
-
1
,
self
.
_out_c
]
)
y
=
paddle
.
flatten
(
y
,
start_axis
=
1
,
stop_axis
=-
1
)
y
=
self
.
_fc
(
y
)
return
y
...
...
ppcls/modeling/architectures/vgg.py
浏览文件 @
8dd6418a
...
...
@@ -112,9 +112,7 @@ class VGGNet(nn.Layer):
x
=
self
.
_conv_block_3
(
x
)
x
=
self
.
_conv_block_4
(
x
)
x
=
self
.
_conv_block_5
(
x
)
_
,
c
,
h
,
w
=
list
(
x
.
shape
)
x
=
paddle
.
reshape
(
x
,
[
-
1
,
c
*
h
*
w
])
x
=
paddle
.
flatten
(
x
,
start_axis
=
1
,
stop_axis
=-
1
)
x
=
self
.
_fc1
(
x
)
x
=
F
.
relu
(
x
)
x
=
self
.
_drop
(
x
)
...
...
ppcls/modeling/architectures/xception.py
浏览文件 @
8dd6418a
...
...
@@ -305,7 +305,7 @@ class ExitFlow(nn.Layer):
conv2
=
self
.
_conv_2
(
conv1
)
conv2
=
F
.
relu
(
conv2
)
pool
=
self
.
_pool
(
conv2
)
pool
=
paddle
.
reshape
(
pool
,
[
-
1
,
pool
.
shape
[
1
]]
)
pool
=
paddle
.
flatten
(
pool
,
start_axis
=
1
,
stop_axis
=-
1
)
out
=
self
.
_out
(
pool
)
return
out
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录