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

Bug in OBDCImportance #452

Open
ShaowuChen opened this issue Jan 25, 2025 · 0 comments
Open

Bug in OBDCImportance #452

ShaowuChen opened this issue Jan 25, 2025 · 0 comments

Comments

@ShaowuChen
Copy link

ShaowuChen commented Jan 25, 2025

Hi, I am using OBDCImportance for CNN like this

if args.method == "obdc":
    proxy_model.zero_grad()
    imp=pruner.importance
    imp._prepare_model(proxy_model, pruner) # raise error here

But seems the line https://github.com/VainF/Torch-Pruning/blob/adf1b075aa4f53043937d29e1953516ef477fc81/torch_pruning/pruner/importance.py#L611
group = pruner._downstream_node_as_root_if_attention(group)
would return None , and thus the next line
for i, (dep, idxs) in enumerate(group):
would cause
TypeError: 'NoneType' object is not iterable

I'm not sure if I'm using OBDCImportance the wrong way or if there's a bug here.

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

1 participant