VainF / Torch-Pruning

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

idx 的范围超出通道数目范围 #397

Open niranyingluofen opened 3 days ago

niranyingluofen commented 3 days ago

您好,当我在计算group时添加全连接层Linear(in_features=84, out_features=128, bias=False)时,发现layer的idx为[(264, 0), (265, 1), (266, 2), (267, 3), (268, 4), (269, 5), (270, 6), (271, 7), (272, 8), (273, 9), (274, 10), (275, 11), (276, 12), (277, 13), (278, 14), (279, 15), (280, 16), (281, 17), (282, 18), (283, 19), (284, 20), (285, 21), (286, 22), (287, 23), (288, 24), (289, 25), (290, 26), (291, 27), (292, 28), (293, 29), (294, 30), (295, 31), (296, 32), (297, 33), (298, 34), (299, 35), (300, 36), (301, 37), (302, 38), (303, 39), (304, 40), (305, 41), (306, 42), (307, 43), (308, 44), (309, 45), (310, 46), (311, 47), (312, 48), (313, 49), (314, 50), (315, 51), (316, 52), (317, 53), (318, 54), (319, 55), (320, 56), (321, 57), (322, 58), (323, 59), (324, 60), (325, 61), (326, 62), (327, 63)],而全连接层的输出通道为128,idx的索引溢出,请问原因是?

VainF commented 3 days ago

可能模型有点复杂,这是什么模型

Sarthak-22 commented 2 days ago

Hi, even I am facing a similar error where the dependency graph calls an infinite loop at new_indices = mapping(new_indices) step. This error starts to occur around the third group, specifically in the attention layer. I am using Restormer architecture : https://github.com/swz30/Restormer/blob/main/basicsr/models/archs/restormer_arch.py. Any help or idea on this @VainF ?

niranyingluofen commented 2 days ago

Screenshot from 2024-07-03 10-12-21 这是出错部分的模型的截图, image

我查看了一下出错层的整个group发现在第一个concat那里就有问题,这个concat应该是64+3=67也就是[0,64,67],但是在group05中却显示ConcatOp_119[0,64]