-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add OnnxExportJob #429
Add OnnxExportJob #429
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.
No strong objections. Only if it is not planned to include TF model export soon, then we might as well have a Pytorch specific job here.
returnn/compile.py
Outdated
if isinstance(checkpoint, Checkpoint): | ||
raise ValueError("Tensorflow checkpoint export is currently not supported") |
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.
so then remove (tf) Checkpoint
from typehint?
returnn/compile.py
Outdated
@@ -203,3 +205,62 @@ def run(self): | |||
shutil.move(files[0], self.out_op.get_path()) | |||
if len(files) > 1: | |||
shutil.move(files[1], self.out_grad_op.get_path()) | |||
|
|||
|
|||
class OnnxExportJob(Job): |
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.
If the Job anyway only supports PT based models, then we can include it in the name?
class OnnxExportJob(Job): | |
class PtToOnnxExportJob(Job): |
Co-authored-by: Albert Zeyer <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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.
Same as @michelwi.
Co-authored-by: Albert Zeyer <[email protected]>
A wrapper job around the `torch_export_to_onnx.py` tool of RETURNN. Co-authored-by: Albert Zeyer <[email protected]>
A wrapper around the Returnn-Tool. Be aware that I never tested a "normal" pipeline with this, I just used some dummy
torch_export_to_onnx.py
script to verify this jobs works.