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

Dimension error when training dkrl model. #6

Open
moonliii opened this issue Feb 21, 2024 · 3 comments
Open

Dimension error when training dkrl model. #6

moonliii opened this issue Feb 21, 2024 · 3 comments

Comments

@moonliii
Copy link

Hi, thanks for your quick response! When I was running python script/training/repodb/dkrl_grid.py 0 I encountered another issue:
margin_ranking_loss : All input tensors should have same dimension but got sizes: input1: torch.Size([64]), input2: torch.Size([64]), target: torch.Size([64, 1])

@rahuln
Copy link
Owner

rahuln commented Feb 21, 2024

That's strange, when I run the same command I don't get that error - the training and evaluation seems to run fine. Could you provide more details, such as where in the code the error is coming from?

@moonliii
Copy link
Author

In src/lm/run.py, row 678, ranking_lossfn(pos, neg, batch.labels[:npos]).

@rahuln
Copy link
Owner

rahuln commented Feb 23, 2024

I see, I'm not getting the same error at that line in the code even though all my input tensors are the same sizes (calling the loss function works fine). I would suggest taking a look at the version of torch that you have installed (and maybe other packages as well) and making sure it matches the one in environment.yml, that may be causing the issue.

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