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

RuntimeError: mat1 dim 1 must match mat2 dim 0 #4

Open
jvel07 opened this issue Mar 3, 2021 · 2 comments
Open

RuntimeError: mat1 dim 1 must match mat2 dim 0 #4

jvel07 opened this issue Mar 3, 2021 · 2 comments

Comments

@jvel07
Copy link

jvel07 commented Mar 3, 2021

Hi, congrats on the project!
I am getting this error, could not figure out what's going on:

File "/media/user/hk-data/PycharmProjects/dnn_embeddings_pytorch/train_model.py", line 148, in train_model
output = net(x_train)
File "/home/user/anaconda3/envs/general_py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/media/user/hk-data/PycharmProjects/dnn_embeddings_pytorch/dnn_models.py", line 240, in forward
output_logits = self.fc1_linear(complete_embedding)
File "/home/user/anaconda3/envs/general_py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/user/anaconda3/envs/general_py37/lib/python3.7/site-packages/torch/nn/modules/linear.py", line 93, in forward
return F.linear(input, self.weight, self.bias)
File "/home/user/anaconda3/envs/general_py37/lib/python3.7/site-packages/torch/nn/functional.py", line 1690, in linear
ret = torch.addmm(bias, input, weight.t())
RuntimeError: mat1 dim 1 must match mat2 dim 0

@jvel07
Copy link
Author

jvel07 commented Mar 3, 2021

I actually found out why. It is due to the shape of my MFCCs. The shape I have is (1, 40, 498).
In your case, it is (1, 40, 282). How could I adapt to the shape of my MFCCs?

@IliaZenkov
Copy link
Owner

IliaZenkov commented Mar 3, 2021 via email

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