-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Static quantization crashes with "TypeError: iteration over a 0-d array" #19529
Labels
quantization
issues related to quantization
Comments
PR #19591 fixes this issue. Am I allowed to use the model to write the unit test checking the bug never shows up again? |
Yes, you can use the model for the test. Thanks for the quick fix!
Kind regards,
Stefan Erlbeck
Von: Xavier Dupré ***@***.***>
Gesendet: Mittwoch, 21. Februar 2024 19:08
An: microsoft/onnxruntime ***@***.***>
Cc: Stefan Erlbeck ***@***.***>; Author ***@***.***>
Betreff: Re: [microsoft/onnxruntime] Static quantization crashes with "TypeError: iteration over a 0-d array" (Issue #19529)
PR #19591<#19591> fixes this issue. Am I allowed to use the model to write the unit test checking the bug never shows up again?
—
Reply to this email directly, view it on GitHub<#19529 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BGFXI3TVZIXRWE6SVWQO6W3YUYZXNAVCNFSM6AAAAABDKHMLR2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJXGU3DSMRXGA>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
|
xadupre
added a commit
that referenced
this issue
Apr 24, 2024
TedThemistokleous
pushed a commit
to TedThemistokleous/onnxruntime
that referenced
this issue
May 7, 2024
### Description Fix issue microsoft#19529, the code was using a variable loop outside a loop.
rexlee8776
pushed a commit
to Deep-Spark/DeepSparkInference
that referenced
this issue
Jan 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the issue
During static quantization with percentile calibration, the following crash happens with onnxruntime-gpu 1.17.0:
Collecting tensor data and making histogram ...
Traceback (most recent call last):
File ".\new_onnx_quantize_static.py", line 21, in
oq.quantize_static(preprocessed_path, quantized_path, Mock(),
File "D:\Tools\Venv\NewestOnnx\lib\site-packages\onnxruntime\quantization\quantize.py", line 496, in quantize_static
calibrator.collect_data(calibration_data_reader)
File "D:\Tools\Venv\NewestOnnx\lib\site-packages\onnxruntime\quantization\calibrate.py", line 546, in collect_data
self.collector.collect(clean_merged_dict)
File "D:\Tools\Venv\NewestOnnx\lib\site-packages\onnxruntime\quantization\calibrate.py", line 724, in collect
return self.collect_absolute_value(name_to_arr)
File "D:\Tools\Venv\NewestOnnx\lib\site-packages\onnxruntime\quantization\calibrate.py", line 739, in collect_absolute_value
dtypes = set(a.dtype for a in arr)
TypeError: iteration over a 0-d array
Older onnxruntime versions did not have this issue.
To reproduce
Model is: minimal_model.zip. Code to reproduce:
Urgency
Urgent, since it worked with previous versions of onnxruntime-gpu.
Platform
Windows
OS Version
10
ONNX Runtime Installation
Released Package
ONNX Runtime Version or Commit ID
1.17.0
ONNX Runtime API
Python
Architecture
X64
Execution Provider
CUDA
Execution Provider Library Version
CUDA 11.6
The text was updated successfully, but these errors were encountered: