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

使用paddleseg中的slim剪枝Bisenetv2出现AssertionError: The length of current_mask must be equal to the size of dimension to be pruned on. #1742

Open
zhaoyj96 opened this issue Nov 19, 2023 · 1 comment
Assignees

Comments

@zhaoyj96
Copy link

No description provided.

@zhaoyj96 zhaoyj96 changed the title 使用paddleseg中的slim剪枝B森额头、 使用paddleseg中的slim剪枝Bisenetv2出现AssertionError: The length of current_mask must be equal to the size of dimension to be pruned on. Nov 19, 2023
@zhaoyj96
Copy link
Author

2023-11-20 03:12:52,715-WARNING: Leaves ['batch_norm_0.tmp_0', 'batch_norm_0.tmp_1', 'batch_norm_0.tmp_3', 'batch_norm_1.tmp_0', 'batch_norm_1.tmp_1', 'batch_norm_1.tmp_3', 'batch_norm_2.tmp_0', 'batch_norm_2.tmp_1', 'batch_norm_2.tmp_3', 'batch_norm_3.tmp_0', 'batch_norm_3.tmp_1', 'batch_norm_3.tmp_3', 'batch_norm_4.tmp_0', 'batch_norm_4.tmp_1', 'batch_norm_4.tmp_3', 'batch_norm_5.tmp_0', 'batch_norm_5.tmp_1', 'batch_norm_5.tmp_3', 'batch_norm_6.tmp_0', 'batch_norm_6.tmp_1', 'batch_norm_6.tmp_3', 'batch_norm_7.tmp_0', 'batch_norm_7.tmp_1', 'batch_norm_7.tmp_3', 'batch_norm_8.tmp_0', 'batch_norm_8.tmp_1', 'batch_norm_8.tmp_3', 'batch_norm_9.tmp_0', 'batch_norm_9.tmp_1', 'batch_norm_9.tmp_3', 'batch_norm_10.tmp_0', 'batch_norm_10.tmp_1', 'batch_norm_10.tmp_3', 'pool2d_0.tmp_1', 'batch_norm_11.tmp_0', 'batch_norm_11.tmp_1', 'batch_norm_11.tmp_3', 'batch_norm_12.tmp_0', 'batch_norm_12.tmp_1', 'batch_norm_12.tmp_3', 'batch_norm_13.tmp_0', 'batch_norm_13.tmp_1', 'batch_norm_13.tmp_3', 'batch_norm_14.tmp_0', 'batch_norm_14.tmp_1', 'batch_norm_14.tmp_3', 'batch_norm_15.tmp_0', 'batch_norm_15.tmp_1', 'batch_norm_15.tmp_3', 'batch_norm_16.tmp_0', 'batch_norm_16.tmp_1', 'batch_norm_16.tmp_3', 'batch_norm_17.tmp_0', 'batch_norm_17.tmp_1', 'batch_norm_17.tmp_3', 'batch_norm_18.tmp_0', 'batch_norm_18.tmp_1', 'batch_norm_18.tmp_3', 'batch_norm_19.tmp_0', 'batch_norm_19.tmp_1', 'batch_norm_19.tmp_3', 'batch_norm_20.tmp_0', 'batch_norm_20.tmp_1', 'batch_norm_20.tmp_3', 'batch_norm_21.tmp_0', 'batch_norm_21.tmp_1', 'batch_norm_21.tmp_3', 'batch_norm_22.tmp_0', 'batch_norm_22.tmp_1', 'batch_norm_22.tmp_3', 'batch_norm_23.tmp_0', 'batch_norm_23.tmp_1', 'batch_norm_23.tmp_3', 'batch_norm_24.tmp_0', 'batch_norm_24.tmp_1', 'batch_norm_24.tmp_3', 'batch_norm_25.tmp_0', 'batch_norm_25.tmp_1', 'batch_norm_25.tmp_3', 'batch_norm_26.tmp_0', 'batch_norm_26.tmp_1', 'batch_norm_26.tmp_3', 'batch_norm_27.tmp_0', 'batch_norm_27.tmp_1', 'batch_norm_27.tmp_3', 'batch_norm_28.tmp_0', 'batch_norm_28.tmp_1', 'batch_norm_28.tmp_3', 'batch_norm_29.tmp_0', 'batch_norm_29.tmp_1', 'batch_norm_29.tmp_3', 'batch_norm_30.tmp_0', 'batch_norm_30.tmp_1', 'batch_norm_30.tmp_3', 'batch_norm_31.tmp_0', 'batch_norm_31.tmp_1', 'batch_norm_31.tmp_3', 'batch_norm_32.tmp_0', 'batch_norm_32.tmp_1', 'batch_norm_32.tmp_3', 'batch_norm_33.tmp_0', 'batch_norm_33.tmp_1', 'batch_norm_33.tmp_3', 'batch_norm_34.tmp_0', 'batch_norm_34.tmp_1', 'batch_norm_34.tmp_3', 'batch_norm_35.tmp_0', 'batch_norm_35.tmp_1', 'batch_norm_35.tmp_3', 'batch_norm_36.tmp_0', 'batch_norm_36.tmp_1', 'batch_norm_36.tmp_3', 'batch_norm_37.tmp_0', 'batch_norm_37.tmp_1', 'batch_norm_37.tmp_3', 'batch_norm_38.tmp_0', 'batch_norm_38.tmp_1', 'batch_norm_38.tmp_3', 'batch_norm_39.tmp_0', 'batch_norm_39.tmp_1', 'batch_norm_39.tmp_3', 'batch_norm_40.tmp_0', 'batch_norm_40.tmp_1', 'batch_norm_40.tmp_3', 'batch_norm_41.tmp_0', 'batch_norm_41.tmp_1', 'batch_norm_41.tmp_3', 'batch_norm_42.tmp_0', 'batch_norm_42.tmp_1', 'batch_norm_42.tmp_3', 'batch_norm_43.tmp_0', 'batch_norm_43.tmp_1', 'batch_norm_43.tmp_3', 'batch_norm_44.tmp_0', 'batch_norm_44.tmp_1', 'batch_norm_44.tmp_3', 'batch_norm_45.tmp_0', 'batch_norm_45.tmp_1', 'batch_norm_45.tmp_3', 'batch_norm_46.tmp_0', 'batch_norm_46.tmp_1', 'batch_norm_46.tmp_3', 'batch_norm_47.tmp_0', 'batch_norm_47.tmp_1', 'batch_norm_47.tmp_3', 'batch_norm_48.tmp_0', 'batch_norm_48.tmp_1', 'batch_norm_48.tmp_3', 'batch_norm_49.tmp_0', 'batch_norm_49.tmp_1', 'batch_norm_49.tmp_3', 'batch_norm_50.tmp_0', 'batch_norm_50.tmp_1', 'batch_norm_50.tmp_3', 'batch_norm_51.tmp_0', 'batch_norm_51.tmp_1', 'batch_norm_51.tmp_3', 'batch_norm_52.tmp_0', 'batch_norm_52.tmp_1', 'batch_norm_52.tmp_3', 'dropout_0.tmp_1', 'batch_norm_53.tmp_0', 'batch_norm_53.tmp_1', 'batch_norm_53.tmp_3', 'dropout_1.tmp_1', 'batch_norm_54.tmp_0', 'batch_norm_54.tmp_1', 'batch_norm_54.tmp_3', 'dropout_2.tmp_1', 'batch_norm_55.tmp_0', 'batch_norm_55.tmp_1', 'batch_norm_55.tmp_3', 'dropout_3.tmp_1', 'batch_norm_56.tmp_0', 'batch_norm_56.tmp_1', 'batch_norm_56.tmp_3', 'dropout_4.tmp_1', 'bilinear_interp_v2_2.tmp_0', 'bilinear_interp_v2_3.tmp_0', 'bilinear_interp_v2_4.tmp_0', 'bilinear_interp_v2_5.tmp_0', 'bilinear_interp_v2_6.tmp_0'] will be skipped when parsing graph.
2023-11-20 03:12:57,790-WARNING: ('Variable bilinear_interp_v2_4.tmp_0 was skipped.',)
2023-11-20 03:12:57,790-WARNING: ('Variable bilinear_interp_v2_6.tmp_0 was skipped.',)
2023-11-20 03:12:57,790-WARNING: ('Variable bilinear_interp_v2_3.tmp_0 was skipped.',)
2023-11-20 03:12:57,790-WARNING: ('Variable bilinear_interp_v2_2.tmp_0 was skipped.',)
2023-11-20 03:12:57,790-WARNING: ('Unsupported operator named concat',)
2023-11-20 03:12:57,790-WARNING: ('Variable dropout_2.tmp_1 was skipped.',)
2023-11-20 03:12:57,790-WARNING: ('Variable dropout_3.tmp_1 was skipped.',)
2023-11-20 03:12:57,790-WARNING: ('Variable dropout_4.tmp_1 was skipped.',)
2023-11-20 03:12:57,790-WARNING: ('Variable dropout_0.tmp_1 was skipped.',)
2023-11-20 03:12:57,791-WARNING: ('Variable dropout_1.tmp_1 was skipped.',)
2023-11-20 03:12:57,791-WARNING: ('Variable bilinear_interp_v2_5.tmp_0 was skipped.',)
2023-11-20 03:12:57,791-INFO: Found 24 collections.
2023-11-20 03:12:57,823-INFO: Load status from F:\1_DLW\PaddleSeg-release-2.8\output\Bisenetv2-prune0.2\sen.pickle
2023-11-20 03:13:02,746-INFO: Pruning variable [conv2d_12.w_0] and its relatives ['conv2d_12.w_0', 'conv2d_12.b_0', 'batch_norm2d_12.w_0', 'batch_norm2d_12.b_0', 'batch_norm2d_12.w_1', 'batch_norm2d_12.w_2', 'conv2d_13.w_0', 'conv2d_13.b_0', 'batch_norm2d_13.w_0', 'batch_norm2d_13.b_0', 'batch_norm2d_13.w_1', 'batch_norm2d_13.w_2', 'conv2d_14.w_0', 'conv2d_14.b_0', 'batch_norm2d_14.w_0', 'batch_norm2d_14.b_0', 'batch_norm2d_14.w_1', 'batch_norm2d_14.w_2', 'conv2d_15.w_0']
Traceback (most recent call last):
File "F:/1_DLW/PaddleSeg-release-2.8/deploy/slim/prune/prune1.py", line 213, in
main(args)
File "F:/1_DLW/PaddleSeg-release-2.8/deploy/slim/prune/prune1.py", line 164, in main
pruner.sensitive(
File "C:\Users\dell\anaconda3\envs\paddle2.4\lib\site-packages\paddleslim\dygraph\prune\filter_pruner.py", line 124, in sensitive
self._cal_sensitive(
File "C:\Users\dell\anaconda3\envs\paddle2.4\lib\site-packages\paddleslim\dygraph\prune\filter_pruner.py", line 266, in _cal_sensitive
plan = self.prune_var(var_name, dims, ratio)
File "C:\Users\dell\anaconda3\envs\paddle2.4\lib\site-packages\paddleslim\dygraph\prune\filter_pruner.py", line 346, in prune_var
assert len(current_mask) == var_shape[
AssertionError: The length of current_mask must be equal to the size of dimension to be pruned on. But get: len(current_mask): 16; var_shape: (96,); axis: 0; var name: conv2d_13.b_0; len(mask): 16

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