Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
a829051a
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看板
提交
a829051a
编写于
7月 19, 2019
作者:
J
jiangjiajun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
structure modify
上级
86170c37
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
1 deletion
+25
-1
x2paddle/core/graph.py
x2paddle/core/graph.py
+0
-1
x2paddle/core/op_mapper.py
x2paddle/core/op_mapper.py
+15
-0
x2paddle/op_mapper/caffe_op_mapper.py
x2paddle/op_mapper/caffe_op_mapper.py
+5
-0
x2paddle/op_mapper/tf_op_mapper.py
x2paddle/op_mapper/tf_op_mapper.py
+5
-0
未找到文件。
x2paddle/core/graph.py
浏览文件 @
a829051a
...
@@ -61,7 +61,6 @@ class Graph(object):
...
@@ -61,7 +61,6 @@ class Graph(object):
num_inputs
=
dict
()
num_inputs
=
dict
()
for
name
,
node
in
self
.
node_map
.
items
():
for
name
,
node
in
self
.
node_map
.
items
():
num_inputs
[
name
]
=
len
(
node
.
inputs
)
num_inputs
[
name
]
=
len
(
node
.
inputs
)
print
(
len
(
self
.
node_map
))
self
.
topo_sort
=
self
.
input_nodes
[:]
self
.
topo_sort
=
self
.
input_nodes
[:]
idx
=
0
idx
=
0
...
...
x2paddle/core/op_mapper.py
浏览文件 @
a829051a
...
@@ -23,6 +23,21 @@ class OpMapper(object):
...
@@ -23,6 +23,21 @@ class OpMapper(object):
self
.
net_code
=
list
()
self
.
net_code
=
list
()
self
.
weights
=
dict
()
self
.
weights
=
dict
()
def
op_checker
(
self
):
unsupported_ops
=
set
()
for
node_name
in
self
.
graph
.
topo_sort
:
node
=
self
.
graph
.
get_node
(
node_name
)
op
=
node
.
layer_type
if
not
hasattr
(
self
,
op
):
unsupported_ops
.
add
(
op
)
if
len
(
unsupported_ops
)
==
0
:
return
True
else
:
print
(
"There are {} ops not supported yet, list as below"
)
for
op
in
unsupported_ops
:
print
(
op
)
return
False
def
add_codes
(
self
,
codes
,
indent
=
0
):
def
add_codes
(
self
,
codes
,
indent
=
0
):
if
isinstance
(
codes
,
list
):
if
isinstance
(
codes
,
list
):
for
code
in
codes
:
for
code
in
codes
:
...
...
x2paddle/op_mapper/caffe_op_mapper.py
浏览文件 @
a829051a
...
@@ -31,6 +31,11 @@ class CaffeOpMapper(OpMapper):
...
@@ -31,6 +31,11 @@ class CaffeOpMapper(OpMapper):
def
run
(
self
):
def
run
(
self
):
print
(
"Total nodes: {}"
.
format
(
len
(
self
.
graph
.
topo_sort
)))
print
(
"Total nodes: {}"
.
format
(
len
(
self
.
graph
.
topo_sort
)))
# check if ops in model are all supported
if
not
self
.
op_checker
():
raise
Exception
(
"Model are not supported yet."
)
for
node_name
in
self
.
graph
.
topo_sort
:
for
node_name
in
self
.
graph
.
topo_sort
:
node
=
self
.
graph
.
get_node
(
node_name
)
node
=
self
.
graph
.
get_node
(
node_name
)
op
=
node
.
layer_type
op
=
node
.
layer_type
...
...
x2paddle/op_mapper/tf_op_mapper.py
浏览文件 @
a829051a
...
@@ -27,6 +27,11 @@ class TFOpMapper(OpMapper):
...
@@ -27,6 +27,11 @@ class TFOpMapper(OpMapper):
def
run
(
self
):
def
run
(
self
):
print
(
"Total nodes: {}"
.
format
(
len
(
self
.
graph
.
topo_sort
)))
print
(
"Total nodes: {}"
.
format
(
len
(
self
.
graph
.
topo_sort
)))
# check if ops in model are all supported
if
not
self
.
op_checker
():
raise
Exception
(
"Model are not supported yet."
)
for
node_name
in
self
.
graph
.
topo_sort
:
for
node_name
in
self
.
graph
.
topo_sort
:
node
=
self
.
graph
.
get_node
(
node_name
)
node
=
self
.
graph
.
get_node
(
node_name
)
op
=
node
.
layer_type
op
=
node
.
layer_type
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录