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

encounter error #12

Open
SynMarc opened this issue May 17, 2021 · 2 comments
Open

encounter error #12

SynMarc opened this issue May 17, 2021 · 2 comments

Comments

@SynMarc
Copy link

SynMarc commented May 17, 2021

Hi, thank you so much for your code. But it encounter some error when implemented on my terminal. here is the error description follows
File "E:/Detection/swin/swin_transformer.py", line 117, in forward dots += self.pos_embedding[self.relative_indices[:, :, 0], self.relative_indices[:, :, 1]] IndexError: tensors used as indices must be long, byte or bool tensors
Your response will be highly apprecitaed.

@berniwal
Copy link
Owner

Hi, this error has already occured for some in the past #7 #2 , I asumme it occurs for certain numpy/torch versions but you can fix it by replacing the line by [self.relative_indices[:, :, 0].type(torch.long), self.relative_indices[:, :, 1].type(torch.long)].

@zouzouwei
Copy link

Nice , solve my problem.hhh

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

3 participants