PaddlePaddle / PaddleSlim

PaddleSlim is an open-source library for deep model compression and architecture search.
https://paddleslim.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.56k stars 345 forks source link

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

Open Suncheng2022 opened 7 months ago

Suncheng2022 commented 7 months ago

遇到如下报错,不知道为什么,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 commented 7 months ago

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