Torch-Pruning icon indicating copy to clipboard operation
Torch-Pruning copied to clipboard

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

Open byrantz opened this issue 1 year ago • 5 comments

试验时报错:

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 已经更新到最新

byrantz avatar May 01 '23 08:05 byrantz

A similar issue occurred. Did you find any solutions?

dhkim0225 avatar Aug 15 '23 09:08 dhkim0225

@byrantz any updates?

dhkim0225 avatar Aug 31 '23 06:08 dhkim0225

A similar issue occurred. Did you find any solutions?

wujianfei5201314 avatar Oct 25 '23 03:10 wujianfei5201314

me to!

ou1443989517 avatar Jan 30 '24 06:01 ou1443989517

Hi, did anyone find a solution to this problem

Sarthak-22 avatar Jul 02 '24 21:07 Sarthak-22