tanluren / yolov3-channel-and-layer-pruning

yolov3 yolov4 channel and layer pruning, Knowledge Distillation 层剪枝,通道剪枝,知识蒸馏
Apache License 2.0
1.5k stars 446 forks source link

使用同时剪层和通道 #102

Open qybing opened 4 years ago

qybing commented 4 years ago

python layer_channel_prune.py --cfg cfg/my_cfg.cfg --data data/my_data.data --weights weights/last.pt --shortcuts 12 --global_percent 0.8 --layer_keep 0.1 Traceback (most recent call last): File "layer_channel_prune.py", line 272, in compact_model2 = Darknet([compact_model1.hyperparams.copy()] + compact_module_defs, (img_size, img_size)).to(device) File "/opt/code/YOLO/yolov3-channel-and-layer-pruning/models.py", line 223, in init self.module_list, self.routs, self.hyperparams = create_modules(self.module_defs, img_size, arc) File "/opt/code/YOLO/yolov3-channel-and-layer-pruning/models.py", line 57, in create_modules filters = sum([output_filters[i + 1 if i > 0 else i] for i in layers]) File "/opt/code/YOLO/yolov3-channel-and-layer-pruning/models.py", line 57, in filters = sum([output_filters[i + 1 if i > 0 else i] for i in layers]) IndexError: list index out of range

tanluren commented 4 years ago

已更新这个脚本