Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
5db7e067
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看板
提交
5db7e067
编写于
9月 28, 2020
作者:
M
michaelowenliu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove __future__ in mobilenetv3
上级
b23e3ffe
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
48 deletion
+5
-48
dygraph/paddleseg/models/backbones/mobilenetv3.py
dygraph/paddleseg/models/backbones/mobilenetv3.py
+5
-48
未找到文件。
dygraph/paddleseg/models/backbones/mobilenetv3.py
浏览文件 @
5db7e067
...
...
@@ -12,25 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from
__future__
import
absolute_import
from
__future__
import
division
from
__future__
import
print_function
import
math
import
os
import
numpy
as
np
import
paddle
import
paddle.nn
as
nn
import
paddle.nn.functional
as
F
from
paddle.nn
import
Conv2d
,
AdaptiveAvgPool2d
from
paddle.nn
import
SyncBatchNorm
as
BatchNorm
from
paddle
import
ParamAttr
# from paddle.regularizer import L2Decay
from
paddle.fluid.regularizer
import
L2Decay
from
paddle
import
ParamAttr
from
paddleseg.models.common
import
layer_libs
,
activation
from
paddle.nn
import
Conv2d
,
AdaptiveAvgPool2d
from
paddle.nn
import
SyncBatchNorm
as
BatchNorm
from
paddleseg.cvlibs
import
manager
from
paddleseg.models.common
import
activation
from
paddleseg.utils
import
utils
__all__
=
[
...
...
@@ -177,32 +168,6 @@ class MobileNetV3(nn.Layer):
sublayer
=
self
.
block_list
[
-
1
],
name
=
"conv"
+
str
(
i
+
2
))
inplanes
=
make_divisible
(
scale
*
c
)
# self.last_second_conv = ConvBNLayer(
# in_c=inplanes,
# out_c=make_divisible(scale * self.cls_ch_squeeze),
# filter_size=1,
# stride=1,
# padding=0,
# num_groups=1,
# if_act=True,
# act="hard_swish",
# name="conv_last")
# self.pool = Pool2D(
# pool_type="avg", global_pooling=True, use_cudnn=False)
# self.last_conv = Conv2d(
# in_channels=make_divisible(scale * self.cls_ch_squeeze),
# out_channels=self.cls_ch_expand,
# kernel_size=1,
# stride=1,
# padding=0,
# bias_attr=False)
# self.out = Linear(
# input_dim=self.cls_ch_expand,
# output_dim=class_dim)
utils
.
load_pretrained_model
(
self
,
pretrained
)
def
modify_bottle_params
(
self
,
output_stride
=
None
):
...
...
@@ -228,14 +193,6 @@ class MobileNetV3(nn.Layer):
x
=
block
(
x
)
if
i
in
self
.
out_indices
:
feat_list
.
append
(
x
)
#print("block {}:".format(i),x.shape, self.dilation_cfg[i])
# x = self.last_second_conv(x)
# x = self.pool(x)
# x = self.last_conv(x)
# x = F.hard_swish(x)
# x = F.dropout(x=x, dropout_prob=dropout_prob)
# x = paddle.reshape(x, shape=[x.shape[0], x.shape[1]])
# x = self.out(x)
return
feat_list
...
...
@@ -313,7 +270,7 @@ class ResidualUnit(nn.Layer):
stride
=
stride
,
padding
=
get_padding_same
(
filter_size
,
dilation
),
#int((filter_size - 1) // 2) + (dilation - 1),
dilation
),
#
int((filter_size - 1) // 2) + (dilation - 1),
dilation
=
dilation
,
num_groups
=
mid_c
,
if_act
=
True
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录