Skip to content
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

Merged
merged 6 commits into from
Jul 19, 2023
Merged

Add OnnxExportJob #429

merged 6 commits into from
Jul 19, 2023

Conversation

JackTemaki
Copy link
Contributor

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.

Copy link
Contributor

@michelwi michelwi left a 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.

Comment on lines 236 to 237
if isinstance(checkpoint, Checkpoint):
raise ValueError("Tensorflow checkpoint export is currently not supported")
Copy link
Contributor

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?

@@ -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):
Copy link
Contributor

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?

Suggested change
class OnnxExportJob(Job):
class PtToOnnxExportJob(Job):

Co-authored-by: Albert Zeyer <[email protected]>
@vieting

This comment was marked as resolved.

@albertz

This comment was marked as resolved.

@albertz albertz mentioned this pull request Jul 19, 2023
15 tasks
albertz added a commit to rwth-i6/returnn that referenced this pull request Jul 19, 2023
@vieting

This comment was marked as resolved.

returnn/compile.py Outdated Show resolved Hide resolved
@albertz

This comment was marked as resolved.

@vieting

This comment was marked as resolved.

Copy link
Member

@albertz albertz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as @michelwi.

returnn/compile.py Outdated Show resolved Hide resolved
returnn/compile.py Outdated Show resolved Hide resolved
@JackTemaki JackTemaki merged commit 0ae3d64 into main Jul 19, 2023
@christophmluscher christophmluscher deleted the nick_onnx_export branch August 9, 2023 11:06
Atticus1806 pushed a commit that referenced this pull request Oct 2, 2023
A wrapper job around the `torch_export_to_onnx.py` tool of RETURNN.

Co-authored-by: Albert Zeyer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants