VainF / Torch-Pruning

[CVPR 2023] Towards Any Structural Pruning; LLMs / SAM / Diffusion / Transformers / YOLOv8 / CNNs
https://arxiv.org/abs/2301.12900
MIT License
2.59k stars 318 forks source link

pruner.step() 时报错 IndexError: list index out of range #168

Open byrantz opened 1 year ago

byrantz commented 1 year ago

试验时报错:

Traceback (most recent call last):
  File "print.py", line 113, in <module>
    pruner.step()
  File "/home/yxc/anaconda3/envs/top/lib/python3.8/site-packages/torch_pruning/pruner/algorithms/metapruner.py", line 159, in step
    for group in self.prune_local():
  File "/home/yxc/anaconda3/envs/top/lib/python3.8/site-packages/torch_pruning/pruner/algorithms/metapruner.py", line 201, in prune_local
    for group in self.DG.get_all_groups(ignored_layers=self.ignored_layers, root_module_types=self.root_module_types):
  File "/home/yxc/anaconda3/envs/top/lib/python3.8/site-packages/torch_pruning/dependency.py", line 493, in get_all_groups
    group = self.get_pruning_group(
  File "/home/yxc/anaconda3/envs/top/lib/python3.8/site-packages/torch_pruning/dependency.py", line 466, in get_pruning_group
    _fix_dependency_graph_non_recursive(*group[0])
  File "/home/yxc/anaconda3/envs/top/lib/python3.8/site-packages/torch_pruning/dependency.py", line 450, in _fix_dependency_graph_non_recursive
    new_indices = mapping(new_indices)
  File "/home/yxc/anaconda3/envs/top/lib/python3.8/site-packages/torch_pruning/_helpers.py", line 63, in __call__
    new_idxs = [
  File "/home/yxc/anaconda3/envs/top/lib/python3.8/site-packages/torch_pruning/_helpers.py", line 66, in <listcomp>
    if (i >= self.offset[0] and i < self.offset[1])
IndexError: list index out of range

请问这我模型的问题吗,torch-pruning 已经更新到最新

dhkim0225 commented 1 year ago

A similar issue occurred. Did you find any solutions?

dhkim0225 commented 1 year ago

@byrantz any updates?

wujianfei5201314 commented 10 months ago

A similar issue occurred. Did you find any solutions?

ou1443989517 commented 7 months ago

me to!

Sarthak-22 commented 2 months ago

Hi, did anyone find a solution to this problem