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: The size of tensor a (17) must match the size of tensor b (18) at non-singleton dimension 1 #4

Open
marma1ade opened this issue Jan 5, 2021 · 3 comments

Comments

@marma1ade
Copy link

I have this issue in function embedding_rep_loss, the distance_matrix size is 1818, the trans_matrix size is 1717,
when doing :
" rep_loss = torch.sum(torch.tensor(trans_matrix).cuda() * distance_matrix) "
this error occured

@sxlong0205
Copy link

同问,这个问题要怎么解决

@18582088138
Copy link

This issue is due to the use of "args.embedding_emd = True"
In "emd_task_distill.py" +402 , use embedding_rep_loss function that make the tensor shape doesn't match
So make the args.embedding_emd = False can fix this issue

@lxk00
Copy link
Owner

lxk00 commented Jun 1, 2022

Sorry there is indeed an error here. Code are fixed.

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

4 participants