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

Support >2GB ONNX models for fp16 conversion #167

Merged
merged 3 commits into from
Jan 11, 2021

Conversation

yetingqiaqia
Copy link
Contributor

@yetingqiaqia yetingqiaqia commented Jan 8, 2021

The original infer_shapes function will fail on model size>2GB, because of protobuf size limitation.
Error message:
image

For >2GB model shape infer, it should use a new function introduced in onnx 1.7.0, infer_shapes_path. However, this new function requires the input and output to be model path, instead of ModelProto object.

Here is my previous issue report to ONNX: onnx/onnx#3046
Here is the doc for infer_shapes_path: https://github.com/onnx/onnx/blob/master/docs/PythonAPIOverview.md#shape-inference-a-large-onnx-model-2gb

Copy link
Contributor

@TomWildenhain-Microsoft TomWildenhain-Microsoft left a comment

Choose a reason for hiding this comment

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

Thanks again for your help with this.

onnxconverter_common/float16.py Show resolved Hide resolved
onnxconverter_common/float16.py Outdated Show resolved Hide resolved
onnxconverter_common/float16.py Show resolved Hide resolved
@yetingqiaqia yetingqiaqia merged commit dd5f259 into master Jan 11, 2021
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.

2 participants