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

Model size check doesn't seem to work #39

Open
kleiti opened this issue Nov 12, 2024 · 5 comments
Open

Model size check doesn't seem to work #39

kleiti opened this issue Nov 12, 2024 · 5 comments

Comments

@kleiti
Copy link

kleiti commented Nov 12, 2024

Even with my model that is less than 250KB in size, I get the onnx_data file after quantization.

save_as_external_data=True,

@mengniwang95
Copy link
Contributor

Hi, is your original model format .onnx file + weight file?

if init.HasField("data_location") and init.data_location == onnx.TensorProto.EXTERNAL:

If the original format is .onnx file + weight file, saving operation will follow it.

@kleiti
Copy link
Author

kleiti commented Nov 13, 2024

My model is just the .onnx file, no external weight file.

@mengniwang95
Copy link
Contributor

mengniwang95 commented Nov 13, 2024

Do you quantize the model with this API

?
If so, during optimization it will save external data if model size > min_size:
"session.optimized_model_external_initializers_min_size_in_bytes", "1024"

@kleiti
Copy link
Author

kleiti commented Nov 13, 2024

Yes, I do quantize using that API. Why is the size limit so low?

@mengniwang95
Copy link
Contributor

Since onnxruntime can load external data automatically and we find model with external data format can be processed faster. But according to you case, the size limitation may need optimization.
Do you have some limitations to use external data format?

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

No branches or pull requests

2 participants