Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
2e5e058c
Unverified
Commit
2e5e058c
authored
Dec 11, 2020
by
David Fan
Committed by
GitHub
Dec 12, 2020
Browse files
Adapt to new pytorch onnx exporter API for dictionary (#3160)
* Adapt to new torch export API for dictionary
parent
0963ff71
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
.circleci/config.yml
.circleci/config.yml
+1
-1
.circleci/config.yml.in
.circleci/config.yml.in
+1
-1
test/test_onnx.py
test/test_onnx.py
+5
-1
No files found.
.circleci/config.yml
View file @
2e5e058c
...
...
@@ -157,7 +157,7 @@ jobs:
# need to install torchvision dependencies due to transitive imports
pip install --user --progress-bar off --editable .
pip install --user onnx
pip install --user
-i https://test.pypi.org/simple/ ort-nightly==1.5.2.dev202012031
pip install --user
onnxruntime
python test/test_onnx.py
binary_linux_wheel
:
...
...
.circleci/config.yml.in
View file @
2e5e058c
...
...
@@ -157,7 +157,7 @@ jobs:
# need to install torchvision dependencies due to transitive imports
pip install --user --progress-bar off --editable .
pip install --user onnx
pip install --user
-i https://test.pypi.org/simple/ ort-nightly==1.5.2.dev202012031
pip install --user
onnxruntime
python test/test_onnx.py
binary_linux_wheel:
...
...
test/test_onnx.py
View file @
2e5e058c
...
...
@@ -33,8 +33,12 @@ class ONNXExporterTester(unittest.TestCase):
model
.
eval
()
onnx_io
=
io
.
BytesIO
()
if
isinstance
(
inputs_list
[
0
][
-
1
],
dict
):
torch_onnx_input
=
inputs_list
[
0
]
+
({},)
else
:
torch_onnx_input
=
inputs_list
[
0
]
# export to onnx with the first input
torch
.
onnx
.
export
(
model
,
inputs_list
[
0
]
,
onnx_io
,
torch
.
onnx
.
export
(
model
,
torch_onnx_input
,
onnx_io
,
do_constant_folding
=
do_constant_folding
,
opset_version
=
_onnx_opset_version
,
dynamic_axes
=
dynamic_axes
,
input_names
=
input_names
,
output_names
=
output_names
)
# validate the exported model with onnx runtime
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment