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

Error in structured pruning #6

Open
CatoTea opened this issue Jun 15, 2022 · 0 comments
Open

Error in structured pruning #6

CatoTea opened this issue Jun 15, 2022 · 0 comments

Comments

@CatoTea
Copy link

CatoTea commented Jun 15, 2022

Hi, when I prune resnet in structured type, I got error like this:

Traceback (most recent call last):
File "prune.py", line 131, in
pruner.prune(model, prune_rate)
File "/content/deep-compression-master/pruners/l1_pruner.py", line 70, in prune
self.structured_prune(model, prune_rate)
File "/content/deep-compression-master/pruners/l1_pruner.py", line 30, in structured_prune
threshold = np.percentile(channel_norms, prune_rate)
File "<array_function internals>", line 6, in percentile
File "/usr/local/lib/python3.7/dist-packages/numpy/lib/function_base.py", line 3868, in percentile
a, q, axis, out, overwrite_input, interpolation, keepdims)
File "/usr/local/lib/python3.7/dist-packages/numpy/lib/function_base.py", line 3988, in _quantile_unchecked
interpolation=interpolation)
File "/usr/local/lib/python3.7/dist-packages/numpy/lib/function_base.py", line 3564, in _ureduce
r = func(a, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/numpy/lib/function_base.py", line 4103, in _quantile_ureduce_func
)), axis=0)
ValueError: operands could not be broadcast together with shapes (128,) (64,)

It seems because some element's lenth in channel_norms list are different. What should I do?

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