-
Notifications
You must be signed in to change notification settings - Fork 124
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
mat1 and mat2 shapes cannot be multiplied #269
Comments
This has nothing to do with torchinfo; the shapes of your convolutions don't work together with the input size. For example, I tried your model on a tensor of shape (8, 1, 201), and it gives a similar error:
|
@snimu I experienced the same error although my architecture is different In my case,
to
|
Can you post a reproducible example here? From the original comment on this thread, it seems to be a problem with the original model or input rather than an issue with torchinfo. |
Describe the bug
I have built a cnn architecture using conv1d and activation layers for a regression task at hand. Now when I am trying to print the summary of the architecture it is showing me the following error:
mat1 and mat2 shapes cannot be multiplied (1x1280 and 640x1)
To Reproduce
My architecture is as follows :
class Regression(nn.Module):
def init(self):
super().init()
self.model = nn.Sequential(
nn.Conv1d(1, 32, 2).float(),
nn.ReLU(),
nn.Conv1d(32, 64, 2).float(),
nn.ReLU(),
nn.Conv1d(64, 128, 2).float(),
nn.ReLU(),
nn.Flatten(start_dim = 0),
nn.Linear(128*5, 1)
)
def forward(self, x):
return self.model(x)
Expected behaviour
I should get the summary of the model showing me the output shapes and the number of parameters.
The text was updated successfully, but these errors were encountered: