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

size mismatch, m1: [2 x 288], m2: [8 x 120] #39

Open
tejalal opened this issue Feb 24, 2020 · 1 comment
Open

size mismatch, m1: [2 x 288], m2: [8 x 120] #39

tejalal opened this issue Feb 24, 2020 · 1 comment

Comments

@tejalal
Copy link

tejalal commented Feb 24, 2020

I am trying to prune simple LeNet5 model using L1-norm pruning and CIFAR10 dataset. The model has 6 kernels in the first layer and 16 in the second convolutional layer. The output of the last convolutional layer of the original model is 16x6x6 and the number of nodes in the first dense layer is 120 which makes a matrics of [576, 120]. The output dimension of the last convolutional layer after pruning (5 kernels are pruned from first layer and 8 from second layer) is 6x6x8 that makes a matrics of [288, 120]. But while training it is giving dimension mismatch error. The problem is in copying weights from original model to pruned model in the dense layer. Here is the code where weights are being copied.

Untitled

size mismatch, m1: [2 x 288], m2: [8 x 120] at /pytorch/aten/src/THC/generic/THCTensorMathBlas.cu:290
Any Suggestions ???

@Eric-mingjie
Copy link
Owner

The pruning code may not work for architectures not stated in the README. So you may need to update the code for pruning lenet?

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