-
Notifications
You must be signed in to change notification settings - Fork 4.3k
enforce onnx conversion in CI #3628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior is rather complex and I would like to see a docstring around what is the expected behavior. I think we will always try to convert to ONNX when possible and if we force it, we will raise an error when not possible.
There are 3 flags : ONNX_EXPORT_ENABLED
, settings.convert_to_onnx
and TEST_ENFORCE_ONNX_CONVERSION
and I think they should have a comment associated to distinguish them
@@ -18,6 +21,11 @@ | |||
from tensorflow.python.framework import graph_util | |||
from mlagents.trainers import tensorflow_to_barracuda as tf2bc | |||
|
|||
if LooseVersion(tf.__version__) < LooseVersion("1.12.0"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also filter out tf 2.x ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to explicitly filter it out. A future version of tf2onnx should support f2 2.x, in which case the import
should succeed.
else: | ||
if _enforce_onnx_conversion(): | ||
raise RuntimeError( | ||
"ONNX conversion enforced, but couldn't import dependencies." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not true, it could also be because the version does not match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I'll update the comment here. It's not something a user will ever see (unless they added the environment variable), though.
I realize now, this is for release, not master. |
Proposed change(s)
Cherry pick of #3600 to the release branch
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
Types of change(s)
Checklist
Other comments