Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow_convert_tools
提交
82fc5ede
O
oneflow_convert_tools
项目概览
Oneflow-Inc
/
oneflow_convert_tools
上一次同步 2 年多
通知
1
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oneflow_convert_tools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
82fc5ede
编写于
11月 02, 2021
作者:
X
Xiaoyu Zhang
提交者:
GitHub
11月 02, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix convert bug (#46)
* fix convert bug * refine * update ci test.sh
上级
200a1fbe
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
6 addition
and
8 deletion
+6
-8
ci/test.sh
ci/test.sh
+2
-1
examples/oneflow2onnx/models/test_inceptionv3.py
examples/oneflow2onnx/models/test_inceptionv3.py
+1
-1
examples/oneflow2onnx/models/test_lenet.py
examples/oneflow2onnx/models/test_lenet.py
+2
-1
examples/oneflow2onnx/models/test_resnet50.py
examples/oneflow2onnx/models/test_resnet50.py
+1
-1
setup.py
setup.py
+0
-4
未找到文件。
ci/test.sh
浏览文件 @
82fc5ede
...
@@ -4,4 +4,5 @@ python3 -m pip install --user --upgrade pip
...
@@ -4,4 +4,5 @@ python3 -m pip install --user --upgrade pip
if
[
-f
requirements.txt
]
;
then
python3
-m
pip
install
-r
requirements.txt
--user
;
fi
if
[
-f
requirements.txt
]
;
then
python3
-m
pip
install
-r
requirements.txt
--user
;
fi
python3
-m
pip
install
oneflow
--user
-U
-f
https://staging.oneflow.info/branch/master/cu110
python3
-m
pip
install
oneflow
--user
-U
-f
https://staging.oneflow.info/branch/master/cu110
python3 setup.py
install
python3 setup.py
install
python3
-m
pytest examples/oneflow2onnx
python3
-m
pytest examples/oneflow2onnx/models
examples/oneflow2onnx/models/test_inceptionv3.py
浏览文件 @
82fc5ede
...
@@ -470,6 +470,6 @@ def test_inceptionv3():
...
@@ -470,6 +470,6 @@ def test_inceptionv3():
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
flow
.
save
(
inceptionv3
.
state_dict
(),
tmpdirname
)
flow
.
save
(
inceptionv3
.
state_dict
(),
tmpdirname
)
convert_to_onnx_and_check
(
inceptionv3_graph
,
flow_weight_dir
=
tmpdirname
,
onnx_model_path
=
"/tmp"
)
convert_to_onnx_and_check
(
inceptionv3_graph
,
flow_weight_dir
=
tmpdirname
,
onnx_model_path
=
"/tmp"
,
print_outlier
=
True
)
test_inceptionv3
()
test_inceptionv3
()
examples/oneflow2onnx/models/test_lenet.py
浏览文件 @
82fc5ede
...
@@ -44,6 +44,7 @@ class LeNet(nn.Module):
...
@@ -44,6 +44,7 @@ class LeNet(nn.Module):
return
logits
return
logits
lenet
=
LeNet
()
lenet
=
LeNet
()
lenet
=
lenet
.
to
(
"cuda"
)
lenet
.
eval
()
lenet
.
eval
()
class
lenetGraph
(
flow
.
nn
.
Graph
):
class
lenetGraph
(
flow
.
nn
.
Graph
):
...
@@ -58,7 +59,7 @@ class lenetGraph(flow.nn.Graph):
...
@@ -58,7 +59,7 @@ class lenetGraph(flow.nn.Graph):
def
test_lenet
():
def
test_lenet
():
lenet_graph
=
lenetGraph
()
lenet_graph
=
lenetGraph
()
lenet_graph
.
_compile
(
flow
.
randn
(
1
,
3
,
32
,
32
))
lenet_graph
.
_compile
(
flow
.
randn
(
1
,
3
,
32
,
32
)
.
to
(
"cuda"
)
)
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
flow
.
save
(
lenet
.
state_dict
(),
tmpdirname
)
flow
.
save
(
lenet
.
state_dict
(),
tmpdirname
)
...
...
examples/oneflow2onnx/models/test_resnet50.py
浏览文件 @
82fc5ede
...
@@ -309,7 +309,7 @@ def test_resnet():
...
@@ -309,7 +309,7 @@ def test_resnet():
resnet_graph
=
ResNetGraph
()
resnet_graph
=
ResNetGraph
()
resnet_graph
.
_compile
(
flow
.
randn
(
1
,
3
,
224
,
224
).
to
(
"cuda"
))
resnet_graph
.
_compile
(
flow
.
randn
(
1
,
3
,
224
,
224
).
to
(
"cuda"
))
print
(
resnet_graph
.
_full_graph_proto
)
#
print(resnet_graph._full_graph_proto)
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
with
tempfile
.
TemporaryDirectory
()
as
tmpdirname
:
flow
.
save
(
resnet
.
state_dict
(),
tmpdirname
)
flow
.
save
(
resnet
.
state_dict
(),
tmpdirname
)
convert_to_onnx_and_check
(
resnet_graph
,
flow_weight_dir
=
tmpdirname
,
onnx_model_path
=
"/tmp"
,
print_outlier
=
False
)
convert_to_onnx_and_check
(
resnet_graph
,
flow_weight_dir
=
tmpdirname
,
onnx_model_path
=
"/tmp"
,
print_outlier
=
False
)
...
...
setup.py
浏览文件 @
82fc5ede
...
@@ -24,11 +24,7 @@ long_description += "Email: zhangxiaoyu@oneflow.org"
...
@@ -24,11 +24,7 @@ long_description += "Email: zhangxiaoyu@oneflow.org"
setuptools
.
setup
(
setuptools
.
setup
(
name
=
"oneflow_onnx"
,
name
=
"oneflow_onnx"
,
<<<<<<<
HEAD
version
=
"0.5.1"
,
version
=
"0.5.1"
,
=======
version
=
"0.5.0.rc"
,
>>>>>>>
parent
of
cca89ba
...
release
v0
.
5.0
(
#42)
author
=
"zhangxiaoyu"
,
author
=
"zhangxiaoyu"
,
author_email
=
"zhangxiaoyu@oneflow.org"
,
author_email
=
"zhangxiaoyu@oneflow.org"
,
description
=
"a toolkit for converting trained model of OneFlow to ONNX and ONNX to OneFlow."
,
description
=
"a toolkit for converting trained model of OneFlow to ONNX and ONNX to OneFlow."
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录