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

报错:var_tensor.shape[0],tuple index out of range #1866

Open
Suncheng2022 opened this issue Apr 8, 2024 · 1 comment
Open

报错:var_tensor.shape[0],tuple index out of range #1866

Suncheng2022 opened this issue Apr 8, 2024 · 1 comment
Assignees

Comments

@Suncheng2022
Copy link

遇到如下报错,不知道为什么,dataloader拿出的数据应该是正确的
Mon Apr 08 21:36:18-INFO: Collect quantized variable names ...
Sampling stage, Run batch:| | 0/100
Traceback (most recent call last):
File "/home/suncheng01/Projects/Stage1_Deblurring/export/paddleslim_quant_post.py", line 99, in
main()
File "/home/suncheng01/Projects/Stage1_Deblurring/export/paddleslim_quant_post.py", line 94, in main
quantize(args)
File "/home/suncheng01/Projects/Stage1_Deblurring/export/paddleslim_quant_post.py", line 74, in quantize
quant_post_static(
File "/opt/conda/lib/python3.10/site-packages/paddleslim/quant/quanter.py", line 669, in quant_post_static
post_training_quantization.quantize()
File "/opt/conda/lib/python3.10/site-packages/paddle/static/quantization/post_training_quantization.py", line 480, in quantize
self._sampling()
File "/opt/conda/lib/python3.10/site-packages/paddle/static/quantization/post_training_quantization.py", line 748, in _sampling
self._sample_avg()
File "/opt/conda/lib/python3.10/site-packages/paddle/static/quantization/post_training_quantization.py", line 904, in _sample_avg
np.abs(var_tensor.reshape(var_tensor.shape[0], -1)),
IndexError: tuple index out of range

@wanghaoshuang
Copy link
Collaborator

看起来还是某一层的输入shape 不对,可以给一个能复现该问题的完整示例吗?

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

3 participants