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

AttributeError: 'DistributedDataParallel' object has no attribute 'module_list' #4

Open shuncyu opened 4 years ago

shuncyu commented 4 years ago

for idx in prune_idx: bn_weights = gather_bn_weights(model.module_list, [idx]) tb_writer.add_histogram('before_train_perlayer_bn_weights/hist', bn_weights.numpy(), idx, bins='doane')

作者新加的这部分代码报错,如上

tanluren commented 4 years ago

我只有单卡,所以没弄多卡训练,你可以稍微改下,model.module.module_list,这样就不会报属性错误了。也可以参考这位朋友弄的多卡训练https://github.com/coldlarry/YOLOv3-complete-pruning/blob/master/train.py