Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
965aa978
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看板
提交
965aa978
编写于
8月 03, 2020
作者:
C
Channingss
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support Reisze opset 11
上级
562ffba4
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
29 addition
and
8 deletion
+29
-8
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
+29
-8
未找到文件。
x2paddle/op_mapper/onnx2paddle/opset9/opset.py
浏览文件 @
965aa978
...
@@ -332,10 +332,37 @@ class OpSet9():
...
@@ -332,10 +332,37 @@ class OpSet9():
def
_interpolate
(
self
,
node
):
def
_interpolate
(
self
,
node
):
val_x
=
self
.
graph
.
get_input_node
(
node
,
idx
=
0
,
copy
=
True
)
val_x
=
self
.
graph
.
get_input_node
(
node
,
idx
=
0
,
copy
=
True
)
inputs
=
{
'input'
:
val_x
}
if
node
.
layer_type
==
'Resize'
:
if
node
.
layer_type
==
'Resize'
:
if
len
(
node
.
layer
.
input
)
==
2
:
# opset 10
val_scales
=
self
.
graph
.
get_input_node
(
node
,
idx
=
1
,
copy
=
True
)
inputs
[
'scale'
]
=
val_scales
elif
len
(
node
.
layer
.
input
)
==
3
:
# opset 11
val_scales
=
self
.
graph
.
get_input_node
(
node
,
idx
=
2
,
copy
=
True
)
val_scales
=
self
.
graph
.
get_input_node
(
node
,
idx
=
2
,
copy
=
True
)
inputs
[
'scale'
]
=
val_scales
elif
len
(
node
.
layer
.
input
)
==
4
:
# opset 11
val_sizes
=
self
.
graph
.
get_input_node
(
node
,
idx
=
3
,
copy
=
True
)
var_nc
,
var_hw
=
val_sizes
.
layer_name
+
'_nc'
,
val_sizes
.
layer_name
+
'_hw'
node
.
fluid_code
.
add_layer
(
'split'
,
inputs
=
val_sizes
,
output
=
var_nc
+
','
+
var_hw
,
param_attr
=
{
'dim'
:
0
,
'num_or_sections'
:
[
2
,
2
],
})
node
.
fluid_code
.
add_layer
(
"cast"
,
inputs
=
var_hw
,
output
=
var_hw
,
param_attr
=
{
'dtype'
:
string
(
'int32'
)})
inputs
[
'out_shape'
]
=
var_hw
elif
node
.
layer_type
==
'Upsample'
:
elif
node
.
layer_type
==
'Upsample'
:
val_scales
=
self
.
graph
.
get_input_node
(
node
,
idx
=
1
,
copy
=
True
)
val_scales
=
self
.
graph
.
get_input_node
(
node
,
idx
=
1
,
copy
=
True
)
inputs
[
'scale'
]
=
val_scales
attr
=
{
'name'
:
string
(
node
.
layer_name
)}
attr
=
{
'name'
:
string
(
node
.
layer_name
)}
mode
=
node
.
get_attr
(
'mode'
,
'nearest'
)
mode
=
node
.
get_attr
(
'mode'
,
'nearest'
)
...
@@ -345,13 +372,8 @@ class OpSet9():
...
@@ -345,13 +372,8 @@ class OpSet9():
'Warnning: paddle not support op:resize wiht mode: linear, we use bilinear replace linear'
'Warnning: paddle not support op:resize wiht mode: linear, we use bilinear replace linear'
)
)
fluid_op
=
'resize_bilinear'
fluid_op
=
'resize_bilinear'
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
fluid_op
,
fluid_op
,
inputs
=
inputs
,
output
=
node
,
param_attr
=
attr
)
inputs
=
{
'input'
:
val_x
,
'scale'
:
val_scales
},
output
=
node
,
param_attr
=
attr
)
@
print_mapping_info
@
print_mapping_info
def
RoiAlign
(
self
,
node
):
def
RoiAlign
(
self
,
node
):
...
@@ -497,7 +519,6 @@ class OpSet9():
...
@@ -497,7 +519,6 @@ class OpSet9():
'attribute "shape" of %s not inferred, '
'attribute "shape" of %s not inferred, '
'using value as 1-D tensor may lead to fails'
,
'using value as 1-D tensor may lead to fails'
,
val_output
.
layer_name
,
val_output
.
layer_name
)
val_output
.
layer_name
,
val_output
.
layer_name
)
if
len
(
value
)
==
1
:
if
len
(
value
)
==
1
:
value
=
value
.
tolist
()
value
=
value
.
tolist
()
shape
=
[
1
]
shape
=
[
1
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录