Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
4af3caec
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看板
提交
4af3caec
编写于
8月 08, 2020
作者:
M
mamingjie-China
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug in paddle1.8.3
上级
2913eea1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
5 deletion
+4
-5
x2paddle/op_mapper/tf_op_mapper_nhwc.py
x2paddle/op_mapper/tf_op_mapper_nhwc.py
+3
-4
x2paddle/optimizer/tf_optimizer.py
x2paddle/optimizer/tf_optimizer.py
+1
-1
未找到文件。
x2paddle/op_mapper/tf_op_mapper_nhwc.py
浏览文件 @
4af3caec
...
@@ -333,16 +333,15 @@ class TFOpMapperNHWC(OpMapper):
...
@@ -333,16 +333,15 @@ class TFOpMapperNHWC(OpMapper):
"dilation"
:
dilations
[
2
:
4
],
"dilation"
:
dilations
[
2
:
4
],
"padding"
:
string
(
pad_mode
)
"padding"
:
string
(
pad_mode
)
}
}
if
hasattr
(
node
,
'dilation'
)
and
attr
[
'dilation'
]
==
[
1
,
1
]:
if
hasattr
(
node
,
'dilation'
)
and
attr
[
'dilation'
]
==
[
1
,
1
]:
if
len
(
node
.
dilation
)
==
1
:
if
len
(
node
.
dilation
)
==
1
:
attr
[
'dilation'
]
=
[
1
,
node
.
dilation
[
0
]]
attr
[
'dilation'
]
=
[
1
,
node
.
dilation
[
0
]]
if
c
==
-
1
:
if
c
==
-
1
:
reshape_attr
=
{
"shape"
:
[
0
,
k_size
[
2
],
0
,
0
]}
reshape_attr
=
{
"shape"
:
[
0
,
k_size
[
2
],
0
,
0
]}
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
"reshape"
,
inputs
=
input
,
output
=
input
,
param_attr
=
reshape_attr
)
"reshape"
,
inputs
=
input
,
output
=
input
,
param_attr
=
reshape_attr
)
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
"conv2d"
,
inputs
=
input
,
output
=
node
,
param_attr
=
attr
)
"conv2d"
,
inputs
=
input
,
output
=
node
,
param_attr
=
attr
)
if
not
channel_first
:
if
not
channel_first
:
...
@@ -759,6 +758,7 @@ class TFOpMapperNHWC(OpMapper):
...
@@ -759,6 +758,7 @@ class TFOpMapperNHWC(OpMapper):
begin
=
begin
.
value
.
tolist
()
begin
=
begin
.
value
.
tolist
()
else
:
else
:
begin
=
self
.
decoder
.
infer_tensor
(
begin
).
tolist
()
begin
=
self
.
decoder
.
infer_tensor
(
begin
).
tolist
()
# shape = begin.out_shapes[0]
# shape = begin.out_shapes[0]
# attr = {"shape": shape}
# attr = {"shape": shape}
# node.fluid_code.add_layer(
# node.fluid_code.add_layer(
...
@@ -1101,4 +1101,3 @@ class TFOpMapperNHWC(OpMapper):
...
@@ -1101,4 +1101,3 @@ class TFOpMapperNHWC(OpMapper):
output
=
"{}[{}]"
.
format
(
node
.
layer_name
,
i
)
output
=
"{}[{}]"
.
format
(
node
.
layer_name
,
i
)
node
.
fluid_code
.
add_layer
(
node
.
fluid_code
.
add_layer
(
"data"
,
inputs
=
None
,
output
=
output
,
param_attr
=
attr
)
"data"
,
inputs
=
None
,
output
=
output
,
param_attr
=
attr
)
x2paddle/optimizer/tf_optimizer.py
浏览文件 @
4af3caec
...
@@ -863,7 +863,7 @@ class TFOptimizer(object):
...
@@ -863,7 +863,7 @@ class TFOptimizer(object):
weight
=
numpy
.
expand_dims
(
weight
,
2
)
weight
=
numpy
.
expand_dims
(
weight
,
2
)
weight
=
numpy
.
expand_dims
(
weight
,
3
)
weight
=
numpy
.
expand_dims
(
weight
,
3
)
self
.
op_mapper
.
weights
[
in_nodes3
[
0
].
layer_name
]
=
weight
self
.
op_mapper
.
weights
[
in_nodes3
[
0
].
layer_name
]
=
weight
# fix bug in Paddle1.8.3 and may change in next version
# fix bug in Paddle1.8.3 and may change in next version
.
self
.
op_mapper
.
weights
[
in_nodes3
[
0
].
layer_name
+
self
.
op_mapper
.
weights
[
in_nodes3
[
0
].
layer_name
+
'_1'
]
=
weight
.
reshape
(
1
,
-
1
)
'_1'
]
=
weight
.
reshape
(
1
,
-
1
)
in_nodes3
[
0
].
fluid_code
.
layers
[
0
].
param_attr
[
"shape"
]
=
[
in_nodes3
[
0
].
fluid_code
.
layers
[
0
].
param_attr
[
"shape"
]
=
[
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录