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

Runtime error #6

Closed
QinchengZhang opened this issue Apr 6, 2021 · 1 comment
Closed

Runtime error #6

QinchengZhang opened this issue Apr 6, 2021 · 1 comment

Comments

@QinchengZhang
Copy link

I'm running an error in your code at line 117
dots += self.pos_embedding[self.relative_indices[:, :, 0], self.relative_indices[:, :, 1]]
IndexError: tensors used as indices must be long, byte or bool tensors

@berniwal
Copy link
Owner

berniwal commented Apr 6, 2021

Thank you for reporting the error, it seems that the error occurs for some and upgrading to different numpy version or changing to [self.relative_indices[:, :, 0].type(torch.long), self.relative_indices[:, :, 1].type(torch.long)] solves the issue.

Unfortunately, I could not reproduce the error on my machine therefore it would be useful to know how did you resolve the error in your case and could you tell me more about your configuration, what operating system you use, what numpy, torch and python versions you are using?

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