Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
1271bd02
X
X2Paddle
项目概览
PaddlePaddle
/
X2Paddle
1 年多 前同步成功
通知
328
Star
698
Fork
167
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
26
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
X2Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
26
Issue
26
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1271bd02
编写于
7月 28, 2020
作者:
driftcloudy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
caffe2paddle, support relu6/upsample,compatible with LeakyReLU,repair axpy and dropout
上级
d142d861
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
16 deletion
+15
-16
x2paddle/decoder/caffe_decoder.py
x2paddle/decoder/caffe_decoder.py
+5
-2
x2paddle/op_mapper/caffe_custom_layer/relu6.py
x2paddle/op_mapper/caffe_custom_layer/relu6.py
+1
-4
x2paddle/op_mapper/caffe_custom_layer/upsample.py
x2paddle/op_mapper/caffe_custom_layer/upsample.py
+7
-5
x2paddle/op_mapper/caffe_op_mapper.py
x2paddle/op_mapper/caffe_op_mapper.py
+2
-5
未找到文件。
x2paddle/decoder/caffe_decoder.py
浏览文件 @
1271bd02
...
...
@@ -93,10 +93,13 @@ class CaffeGraph(Graph):
drop_layer_bottom
=
layer
.
bottom
[
0
]
if
drop_layer_top
!=
drop_layer_bottom
:
for
next_layer
in
layers
:
for
next_layer_bottom_idx
,
next_layer_bottom
in
enumerate
(
next_layer
.
bottom
):
for
next_layer_bottom_idx
,
next_layer_bottom
in
enumerate
(
next_layer
.
bottom
):
if
drop_layer_top
==
next_layer_bottom
:
next_layer
.
bottom
.
remove
(
drop_layer_top
)
next_layer
.
bottom
.
insert
(
next_layer_bottom_idx
,
drop_layer_bottom
)
next_layer
.
bottom
.
insert
(
next_layer_bottom_idx
,
drop_layer_bottom
)
if
not
exclude
:
filtered_layers
.
append
(
layer
)
...
...
x2paddle/op_mapper/caffe_custom_layer/relu6.py
浏览文件 @
1271bd02
...
...
@@ -18,7 +18,4 @@ def relu6_weights(name, data=None):
register
(
kind
=
'ReLU6'
,
shape
=
relu6_shape
,
layer
=
relu6_layer
,
weights
=
relu6_weights
)
kind
=
'ReLU6'
,
shape
=
relu6_shape
,
layer
=
relu6_layer
,
weights
=
relu6_weights
)
x2paddle/op_mapper/caffe_custom_layer/upsample.py
浏览文件 @
1271bd02
...
...
@@ -42,10 +42,8 @@ def upsample_layer(inputs, scale, input_shape=None, name=None):
:return:
"""
x
=
inputs
[
0
]
out
=
fluid
.
layers
.
resize_nearest
(
x
,
align_corners
=
False
,
scale
=
scale
,
name
=
name
)
out
=
fluid
.
layers
.
resize_nearest
(
x
,
align_corners
=
False
,
scale
=
scale
,
name
=
name
)
return
out
...
...
@@ -61,4 +59,8 @@ def upsample_weights(name, data=None):
return
weights_name
register
(
kind
=
'Upsample'
,
shape
=
upsample_shape
,
layer
=
upsample_layer
,
weights
=
upsample_weights
)
register
(
kind
=
'Upsample'
,
shape
=
upsample_shape
,
layer
=
upsample_layer
,
weights
=
upsample_weights
)
x2paddle/op_mapper/caffe_op_mapper.py
浏览文件 @
1271bd02
...
...
@@ -448,14 +448,11 @@ class CaffeOpMapper(OpMapper):
if
params
.
HasField
(
'negative_slope'
)
and
params
.
negative_slope
!=
0
:
negative_slope
=
float
(
params
.
negative_slope
)
attr
=
{
'alpha'
:
negative_slope
}
attr
=
{
'alpha'
:
negative_slope
}
node
.
fluid_code
.
add_layer
(
'leaky_relu'
,
inputs
=
input
,
output
=
node
,
param_attr
=
attr
)
else
:
node
.
fluid_code
.
add_layer
(
'relu'
,
inputs
=
input
,
output
=
node
)
node
.
fluid_code
.
add_layer
(
'relu'
,
inputs
=
input
,
output
=
node
)
def
PReLU
(
self
,
node
):
assert
len
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录