Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
内鬼850
PaddleDetection
提交
eb7b0ddd
P
PaddleDetection
项目概览
内鬼850
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
eb7b0ddd
编写于
2月 27, 2020
作者:
Y
Yang Zhang
提交者:
GitHub
2月 27, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Force `cudnn` backend for depthwise convs when fp16 is enabled (#270)
上级
021a13c7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
7 deletion
+11
-7
ppdet/modeling/backbones/blazenet.py
ppdet/modeling/backbones/blazenet.py
+8
-6
ppdet/modeling/backbones/mobilenet.py
ppdet/modeling/backbones/mobilenet.py
+3
-1
未找到文件。
ppdet/modeling/backbones/blazenet.py
浏览文件 @
eb7b0ddd
...
@@ -19,6 +19,7 @@ from __future__ import print_function
...
@@ -19,6 +19,7 @@ from __future__ import print_function
from
paddle
import
fluid
from
paddle
import
fluid
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
from
ppdet.experimental
import
mixed_precision_global_state
from
ppdet.core.workspace
import
register
from
ppdet.core.workspace
import
register
__all__
=
[
'BlazeNet'
]
__all__
=
[
'BlazeNet'
]
...
@@ -151,6 +152,7 @@ class BlazeNet(object):
...
@@ -151,6 +152,7 @@ class BlazeNet(object):
use_pool
=
not
stride
==
1
use_pool
=
not
stride
==
1
use_double_block
=
double_channels
is
not
None
use_double_block
=
double_channels
is
not
None
act
=
'relu'
if
use_double_block
else
None
act
=
'relu'
if
use_double_block
else
None
mixed_precision_enabled
=
mixed_precision_global_state
()
is
not
None
if
use_5x5kernel
:
if
use_5x5kernel
:
conv_dw
=
self
.
_conv_norm
(
conv_dw
=
self
.
_conv_norm
(
...
@@ -160,7 +162,7 @@ class BlazeNet(object):
...
@@ -160,7 +162,7 @@ class BlazeNet(object):
stride
=
stride
,
stride
=
stride
,
padding
=
2
,
padding
=
2
,
num_groups
=
in_channels
,
num_groups
=
in_channels
,
use_cudnn
=
False
,
use_cudnn
=
mixed_precision_enabled
,
name
=
name
+
"1_dw"
)
name
=
name
+
"1_dw"
)
else
:
else
:
conv_dw_1
=
self
.
_conv_norm
(
conv_dw_1
=
self
.
_conv_norm
(
...
@@ -170,7 +172,7 @@ class BlazeNet(object):
...
@@ -170,7 +172,7 @@ class BlazeNet(object):
stride
=
1
,
stride
=
1
,
padding
=
1
,
padding
=
1
,
num_groups
=
in_channels
,
num_groups
=
in_channels
,
use_cudnn
=
False
,
use_cudnn
=
mixed_precision_enabled
,
name
=
name
+
"1_dw_1"
)
name
=
name
+
"1_dw_1"
)
conv_dw
=
self
.
_conv_norm
(
conv_dw
=
self
.
_conv_norm
(
input
=
conv_dw_1
,
input
=
conv_dw_1
,
...
@@ -179,7 +181,7 @@ class BlazeNet(object):
...
@@ -179,7 +181,7 @@ class BlazeNet(object):
stride
=
stride
,
stride
=
stride
,
padding
=
1
,
padding
=
1
,
num_groups
=
in_channels
,
num_groups
=
in_channels
,
use_cudnn
=
False
,
use_cudnn
=
mixed_precision_enabled
,
name
=
name
+
"1_dw_2"
)
name
=
name
+
"1_dw_2"
)
conv_pw
=
self
.
_conv_norm
(
conv_pw
=
self
.
_conv_norm
(
...
@@ -199,7 +201,7 @@ class BlazeNet(object):
...
@@ -199,7 +201,7 @@ class BlazeNet(object):
num_filters
=
out_channels
,
num_filters
=
out_channels
,
stride
=
1
,
stride
=
1
,
padding
=
2
,
padding
=
2
,
use_cudnn
=
False
,
use_cudnn
=
mixed_precision_enabled
,
name
=
name
+
"2_dw"
)
name
=
name
+
"2_dw"
)
else
:
else
:
conv_dw_1
=
self
.
_conv_norm
(
conv_dw_1
=
self
.
_conv_norm
(
...
@@ -209,7 +211,7 @@ class BlazeNet(object):
...
@@ -209,7 +211,7 @@ class BlazeNet(object):
stride
=
1
,
stride
=
1
,
padding
=
1
,
padding
=
1
,
num_groups
=
out_channels
,
num_groups
=
out_channels
,
use_cudnn
=
False
,
use_cudnn
=
mixed_precision_enabled
,
name
=
name
+
"2_dw_1"
)
name
=
name
+
"2_dw_1"
)
conv_dw
=
self
.
_conv_norm
(
conv_dw
=
self
.
_conv_norm
(
input
=
conv_dw_1
,
input
=
conv_dw_1
,
...
@@ -218,7 +220,7 @@ class BlazeNet(object):
...
@@ -218,7 +220,7 @@ class BlazeNet(object):
stride
=
1
,
stride
=
1
,
padding
=
1
,
padding
=
1
,
num_groups
=
out_channels
,
num_groups
=
out_channels
,
use_cudnn
=
False
,
use_cudnn
=
mixed_precision_enabled
,
name
=
name
+
"2_dw_2"
)
name
=
name
+
"2_dw_2"
)
conv_pw
=
self
.
_conv_norm
(
conv_pw
=
self
.
_conv_norm
(
...
...
ppdet/modeling/backbones/mobilenet.py
浏览文件 @
eb7b0ddd
...
@@ -20,6 +20,7 @@ from paddle import fluid
...
@@ -20,6 +20,7 @@ from paddle import fluid
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.regularizer
import
L2Decay
from
paddle.fluid.regularizer
import
L2Decay
from
ppdet.experimental
import
mixed_precision_global_state
from
ppdet.core.workspace
import
register
from
ppdet.core.workspace
import
register
__all__
=
[
'MobileNet'
]
__all__
=
[
'MobileNet'
]
...
@@ -104,6 +105,7 @@ class MobileNet(object):
...
@@ -104,6 +105,7 @@ class MobileNet(object):
stride
,
stride
,
scale
,
scale
,
name
=
None
):
name
=
None
):
mixed_precision_enabled
=
mixed_precision_global_state
()
is
not
None
depthwise_conv
=
self
.
_conv_norm
(
depthwise_conv
=
self
.
_conv_norm
(
input
=
input
,
input
=
input
,
filter_size
=
3
,
filter_size
=
3
,
...
@@ -111,7 +113,7 @@ class MobileNet(object):
...
@@ -111,7 +113,7 @@ class MobileNet(object):
stride
=
stride
,
stride
=
stride
,
padding
=
1
,
padding
=
1
,
num_groups
=
int
(
num_groups
*
scale
),
num_groups
=
int
(
num_groups
*
scale
),
use_cudnn
=
False
,
use_cudnn
=
mixed_precision_enabled
,
name
=
name
+
"_dw"
)
name
=
name
+
"_dw"
)
pointwise_conv
=
self
.
_conv_norm
(
pointwise_conv
=
self
.
_conv_norm
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录