Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shuncyu opened this issue Nov 28, 2019 · 1 comment

Comments

@shuncyu
Copy link

shuncyu commented Nov 28, 2019

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants