Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
fc6042a3
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看板
提交
fc6042a3
编写于
11月 23, 2020
作者:
S
SunAhong1993
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify caffe
上级
b5281541
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
8 deletion
+5
-8
x2paddle/op_mapper/dygraph/caffe2paddle/caffe_op_mapper.py
x2paddle/op_mapper/dygraph/caffe2paddle/caffe_op_mapper.py
+5
-8
未找到文件。
x2paddle/op_mapper/dygraph/caffe2paddle/caffe_op_mapper.py
浏览文件 @
fc6042a3
...
@@ -527,10 +527,10 @@ class CaffeOpMapper(OpMapper):
...
@@ -527,10 +527,10 @@ class CaffeOpMapper(OpMapper):
assert
len
(
assert
len
(
node
.
inputs
node
.
inputs
)
>=
1
,
"The count of Concat node
\'
s input is not more than 1."
)
>=
1
,
"The count of Concat node
\'
s input is not more than 1."
inputs_list
=
dic
t
()
inputs_list
=
lis
t
()
for
i
in
range
(
len
(
node
.
inputs
)):
for
i
in
range
(
len
(
node
.
inputs
)):
input
=
self
.
graph
.
get_bottom_node
(
node
,
idx
=
i
,
copy
=
True
)
input
=
self
.
graph
.
get_bottom_node
(
node
,
idx
=
i
,
copy
=
True
)
inputs_list
[
i
]
=
self
.
get_input_name
(
input
)
inputs_list
.
append
(
self
.
get_input_name
(
input
)
)
params
=
node
.
layer
.
concat_param
params
=
node
.
layer
.
concat_param
axis
=
params
.
axis
axis
=
params
.
axis
layer_attrs
=
{
'axis'
:
axis
}
layer_attrs
=
{
'axis'
:
axis
}
...
@@ -574,11 +574,9 @@ class CaffeOpMapper(OpMapper):
...
@@ -574,11 +574,9 @@ class CaffeOpMapper(OpMapper):
mode_bool
=
params
.
channel_shared
mode_bool
=
params
.
channel_shared
output_shape
=
node
.
output_shape
[
0
]
output_shape
=
node
.
output_shape
[
0
]
if
mode_bool
:
if
mode_bool
:
mode
=
'all'
num_parameters
=
1
channel
=
None
else
:
else
:
mode
=
'channel'
num_parameters
=
output_shape
[
1
]
channel
=
output_shape
[
1
]
data
=
node
.
data
data
=
node
.
data
self
.
params
[
prelu_name
+
'._weight'
]
=
np
.
squeeze
(
data
[
0
])
self
.
params
[
prelu_name
+
'._weight'
]
=
np
.
squeeze
(
data
[
0
])
assert
data
is
not
None
,
"The parameter of {} (type is {}) is not set. You need to use python package of caffe to set the default value."
.
format
(
assert
data
is
not
None
,
"The parameter of {} (type is {}) is not set. You need to use python package of caffe to set the default value."
.
format
(
...
@@ -587,8 +585,7 @@ class CaffeOpMapper(OpMapper):
...
@@ -587,8 +585,7 @@ class CaffeOpMapper(OpMapper):
"paddle.nn.PReLU"
,
"paddle.nn.PReLU"
,
inputs
=
{
"input"
:
self
.
get_input_name
(
input
)},
inputs
=
{
"input"
:
self
.
get_input_name
(
input
)},
outputs
=
layer_outputs
,
outputs
=
layer_outputs
,
channel
=
channel
,
num_parameters
=
num_parameters
)
mode
=
string
(
mode
))
def
Eltwise
(
self
,
node
):
def
Eltwise
(
self
,
node
):
assert
len
(
assert
len
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录