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

[ONNX] Improve error checking for large model export #37798

Closed
wants to merge 1 commit into from

Conversation

@BowenBao
Copy link
Collaborator

@BowenBao BowenBao commented May 4, 2020

  • Add error message when onnx model file path is not a string.
  • Add error message when model size exceed 2GB when large model export is not turned on.
Copy link
Collaborator

@neginraoof neginraoof left a comment

LGTM. Thanks.

Loading

@@ -957,6 +964,11 @@ std::tuple<std::string, RawDataExportMap> export_onnx(
add_node_names,
use_external_data_format,
onnx_file_path);
const size_t proto_size = graph_encoder.get_model_proto().ByteSizeLong();
Copy link
Member

@houseroad houseroad May 6, 2020

Choose a reason for hiding this comment

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

I am wondering whether model_proto will be larger than 2GB, or just directly truncated when dumping to string.

Loading

Copy link
Member

@houseroad houseroad May 7, 2020

Choose a reason for hiding this comment

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

nvm, not a valid question

Loading

Copy link
Member

@houseroad houseroad left a comment

Looks good. Thanks.

Loading

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

@houseroad has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Loading

@facebook-github-bot
Copy link
Contributor

@facebook-github-bot facebook-github-bot commented May 7, 2020

@houseroad merged this pull request in 122587d.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants