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
Contributor

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.
@BowenBao BowenBao requested a review from apaszke as a code owner May 4, 2020
@ngimel ngimel requested a review from houseroad May 5, 2020
@ngimel ngimel added the triaged label May 5, 2020
Copy link
Collaborator

neginraoof left a comment

LGTM. Thanks.

@@ -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();

This comment has been minimized.

Copy link
@houseroad

houseroad May 6, 2020

Member

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

This comment has been minimized.

Copy link
@houseroad

houseroad May 7, 2020

Member

nvm, not a valid question

Copy link
Member

houseroad left a comment

Looks good. Thanks.

Copy link
Contributor

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.

@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented May 7, 2020

@houseroad merged this pull request in 122587d.

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

6 participants
You can’t perform that action at this time.