Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
bcf4b473
X
X2Paddle
项目概览
PaddlePaddle
/
X2Paddle
12 个月 前同步成功
通知
327
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bcf4b473
编写于
7月 02, 2020
作者:
C
Channingss
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Resize support opset10
上级
1f827c0f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
6 deletion
+37
-6
x2paddle/op_mapper/paddle_op_mapper.py
x2paddle/op_mapper/paddle_op_mapper.py
+37
-6
未找到文件。
x2paddle/op_mapper/paddle_op_mapper.py
浏览文件 @
bcf4b473
...
...
@@ -544,6 +544,11 @@ class PaddleOpMapper(object):
def
bilinear_interp
(
self
,
op
,
block
):
input_names
=
op
.
input_names
input_shape
=
block
.
vars
[
op
.
input
(
'X'
)[
0
]].
shape
batch_size
=
input_shape
[
0
]
channels
=
input_shape
[
1
]
height
=
input_shape
[
2
]
width
=
input_shape
[
3
]
coordinate_transformation_mode
=
'half_pixel'
if
op
.
attr
(
'align_corners'
):
coordinate_transformation_mode
=
'align_corners'
...
...
@@ -598,7 +603,7 @@ class PaddleOpMapper(object):
to
=
onnx_pb
.
TensorProto
.
INT64
)
node_list
.
append
(
cast_shape_node
)
else
:
concat_shape_name
=
self
.
get_name
(
op
.
type
,
"shape.concat"
)
concat_shape_name
=
op
.
output
(
'Out'
)[
0
]
+
"@shape.concat1"
concat_shape_node
=
helper
.
make_node
(
"Concat"
,
inputs
=
op
.
input
(
'SizeTensor'
),
...
...
@@ -611,19 +616,37 @@ class PaddleOpMapper(object):
outputs
=
[
cast_shape_name
],
to
=
onnx_pb
.
TensorProto
.
INT64
)
node_list
.
extend
([
concat_shape_node
,
cast_shape_node
])
shape_name3
=
self
.
get_name
(
op
.
type
,
"shape.concat"
)
shape_name3
=
op
.
output
(
'Out'
)[
0
]
+
"@shape.concat44"
shape_node3
=
helper
.
make_node
(
'Concat'
,
inputs
=
[
shape_name1
,
cast_shape_name
],
outputs
=
[
shape_name3
],
axis
=
0
)
node_list
.
append
(
shape_node3
)
name_h_w
=
op
.
output
(
'Out'
)[
0
]
+
"@h_w"
node_h_w
=
helper
.
make_node
(
'Constant'
,
inputs
=
[],
outputs
=
[
name_h_w
],
value
=
helper
.
make_tensor
(
name
=
name_h_w
,
data_type
=
onnx_pb
.
TensorProto
.
FLOAT
,
dims
=
[
2
],
vals
=
[
height
,
width
],
raw
=
False
))
node_list
.
append
(
node_h_w
)
outputs_h_w_scales
=
op
.
output
(
'Out'
)[
0
]
+
"@out_hw_scales"
node_h_w_scales
=
helper
.
make_node
(
'Div'
,
inputs
=
[
shape_name3
,
name_h_w
],
outputs
=
[
outputs_h_w_scales
])
node_list
.
append
(
node_h_w_scales
)
result_node
=
helper
.
make_node
(
'Resize'
,
inputs
=
[
op
.
input
(
'X'
)[
0
],
roi_name
,
empty_name
,
shape_name3
],
inputs
=
[
op
.
input
(
'X'
)[
0
],
outputs_h_w_scales
],
outputs
=
op
.
output
(
'Out'
),
mode
=
'linear'
,
coordinate_transformation_mode
=
coordinate_transformation_mode
)
node_list
.
extend
([
shape_node3
,
result_node
])
mode
=
'linear'
,
)
node_list
.
extend
([
result_node
])
return
node_list
elif
'Scale'
in
input_names
and
len
(
op
.
input
(
'Scale'
))
>
0
:
node
=
helper
.
make_node
(
...
...
@@ -818,3 +841,11 @@ class PaddleOpMapper(object):
def
im2sequence
(
self
,
op
,
block
):
from
.paddle_custom_layer.im2sequence
import
im2sequence
return
im2sequence
(
op
,
block
)
def
yolo_box
(
self
,
op
,
block
):
from
.paddle_custom_layer.yolo_box
import
yolo_box
return
yolo_box
(
op
,
block
)
def
multiclass_nms
(
self
,
op
,
block
):
from
.paddle_custom_layer.multiclass_nms
import
multiclass_nms
return
multiclass_nms
(
op
,
block
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录