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
nni
Commits
5f91bdfa
Unverified
Commit
5f91bdfa
authored
Aug 09, 2021
by
Yuge Zhang
Committed by
GitHub
Aug 09, 2021
Browse files
Catch exception from ONNX conversion (#4034)
parent
800c675f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
nni/retiarii/evaluator/pytorch/lightning.py
nni/retiarii/evaluator/pytorch/lightning.py
+4
-1
No files found.
nni/retiarii/evaluator/pytorch/lightning.py
View file @
5f91bdfa
...
@@ -178,7 +178,10 @@ class _SupervisedLearningModule(LightningModule):
...
@@ -178,7 +178,10 @@ class _SupervisedLearningModule(LightningModule):
y_hat
=
self
(
x
)
y_hat
=
self
(
x
)
if
not
self
.
_already_exported
:
if
not
self
.
_already_exported
:
self
.
to_onnx
(
self
.
export_onnx
,
x
,
export_params
=
True
)
try
:
self
.
to_onnx
(
self
.
export_onnx
,
x
,
export_params
=
True
)
except
RuntimeError
as
e
:
warnings
.
warn
(
f
'ONNX conversion failed. As a result, you might not be able to use visualization. Error message:
{
e
}
'
)
self
.
_already_exported
=
True
self
.
_already_exported
=
True
self
.
log
(
'val_loss'
,
self
.
criterion
(
y_hat
,
y
),
prog_bar
=
True
)
self
.
log
(
'val_loss'
,
self
.
criterion
(
y_hat
,
y
),
prog_bar
=
True
)
...
...
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