Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
8b21d123
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看板
提交
8b21d123
编写于
11月 27, 2019
作者:
S
SunAhong1993
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the reshape problem
上级
b3838fbd
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
10 deletion
+9
-10
x2paddle/op_mapper/caffe_custom_layer/detectionoutput.py
x2paddle/op_mapper/caffe_custom_layer/detectionoutput.py
+3
-2
x2paddle/op_mapper/caffe_shape.py
x2paddle/op_mapper/caffe_shape.py
+6
-8
未找到文件。
x2paddle/op_mapper/caffe_custom_layer/detectionoutput.py
浏览文件 @
8b21d123
...
@@ -12,6 +12,7 @@ def detectionoutput_layer(inputs,
...
@@ -12,6 +12,7 @@ def detectionoutput_layer(inputs,
share_location
=
True
,
share_location
=
True
,
keep_top_k
=
100
,
keep_top_k
=
100
,
confidence_threshold
=
0.1
,
confidence_threshold
=
0.1
,
num_classes
=
2
,
input_shape
=
None
,
input_shape
=
None
,
name
=
None
):
name
=
None
):
nms_param_str
=
nms_param
nms_param_str
=
nms_param
...
@@ -36,9 +37,9 @@ def detectionoutput_layer(inputs,
...
@@ -36,9 +37,9 @@ def detectionoutput_layer(inputs,
pb
=
fluid
.
layers
.
reshape
(
x
=
pb
,
shape
=
[
-
1
,
4
])
pb
=
fluid
.
layers
.
reshape
(
x
=
pb
,
shape
=
[
-
1
,
4
])
pbv
=
fluid
.
layers
.
reshape
(
x
=
pbv
,
shape
=
[
-
1
,
4
])
pbv
=
fluid
.
layers
.
reshape
(
x
=
pbv
,
shape
=
[
-
1
,
4
])
mbox_loc
=
inputs
[
0
]
mbox_loc
=
inputs
[
0
]
mbox_loc
=
fluid
.
layers
.
reshape
(
x
=
mbox_loc
,
shape
=
[
-
1
,
pb
.
shape
[
0
]
,
4
])
mbox_loc
=
fluid
.
layers
.
reshape
(
x
=
mbox_loc
,
shape
=
[
0
,
-
1
,
4
])
mbox_conf_flatten
=
fluid
.
layers
.
reshape
(
x
=
mbox_conf_flatten
,
mbox_conf_flatten
=
fluid
.
layers
.
reshape
(
x
=
mbox_conf_flatten
,
shape
=
[
0
,
pb
.
shape
[
0
],
-
1
])
shape
=
[
0
,
-
1
,
num_classes
])
default
=
{
"nms_threshold"
:
0.3
,
"top_k"
:
10
,
"eta"
:
1.0
}
default
=
{
"nms_threshold"
:
0.3
,
"top_k"
:
10
,
"eta"
:
1.0
}
fields
=
[
'eta'
,
'top_k'
,
'nms_threshold'
]
fields
=
[
'eta'
,
'top_k'
,
'nms_threshold'
]
...
...
x2paddle/op_mapper/caffe_shape.py
浏览文件 @
8b21d123
...
@@ -293,15 +293,12 @@ def shape_reshape(layer, input_shape):
...
@@ -293,15 +293,12 @@ def shape_reshape(layer, input_shape):
explicit_count
*=
count
(
l
)
explicit_count
*=
count
(
l
)
for
i
in
range
(
len
(
copy_axes
)):
for
i
in
range
(
len
(
copy_axes
)):
explicit_count
*=
outshape
[
start_axis
+
copy_axes
[
i
]]
explicit_count
*=
outshape
[
start_axis
+
copy_axes
[
i
]]
assert
input_count
%
explicit_count
==
0
,
"[Reshape]botom count[%d] "
\
outshape
[
start_axis
+
inferred_axis
]
=
-
1
"must be divisible by product of the specified dimensions[%d] "
\
outshape
[
0
]
=
0
%
(
input_count
,
explicit_count
)
else
:
outshape
[
start_axis
+
inferred_axis
]
=
int
(
input_count
/
explicit_count
)
outshape
[
0
]
=
-
1
output_count
=
count
(
outshape
)
output_count
=
count
(
outshape
)
assert
output_count
==
input_count
,
"[Reshape]output count[%d] must match input count[%d]"
%
(
output_count
,
input_count
)
outshape
[
0
]
=
-
1
return
[
outshape
]
return
[
outshape
]
...
@@ -345,9 +342,10 @@ def shape_flatten(layer, input_shape):
...
@@ -345,9 +342,10 @@ def shape_flatten(layer, input_shape):
output_shape
=
inshape
[
0
:
start_axis
]
output_shape
=
inshape
[
0
:
start_axis
]
if
len
(
inshape
[
start_axis
:
end_axis
])
!=
0
:
if
len
(
inshape
[
start_axis
:
end_axis
])
!=
0
:
flat_sz
=
reduce
(
lambda
a
,
b
:
a
*
b
,
inshape
[
start_axis
:
end_axis
])
flat_sz
=
reduce
(
lambda
a
,
b
:
a
*
b
,
inshape
[
start_axis
:
end_axis
])
flat_sz
=
-
1
output_shape
[
0
]
=
0
output_shape
+=
[
flat_sz
]
output_shape
+=
[
flat_sz
]
output_shape
+=
inshape
[
end_axis
:
len
(
inshape
)]
output_shape
+=
inshape
[
end_axis
:
len
(
inshape
)]
output_shape
[
0
]
=
-
1
return
[
output_shape
]
return
[
output_shape
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录