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

IndexError: tensors used as indices must be long, byte or bool tensors #111

Closed
alexriedel1 opened this issue Feb 22, 2022 · 4 comments · Fixed by #113
Closed

IndexError: tensors used as indices must be long, byte or bool tensors #111

alexriedel1 opened this issue Feb 22, 2022 · 4 comments · Fixed by #113

Comments

@alexriedel1
Copy link
Contributor

Describe the bug
When training PatchCore, I'm getting the following error:
IndexError: tensors used as indices must be long, byte or bool tensors
caused by the line

To Reproduce
Steps to reproduce the behavior:
Run the PatchCore algorithm on CPU (maybe on GPU too)

The problem can be solved by casting to c_idx to c_idx.long()

@innat
Copy link
Contributor

innat commented Feb 23, 2022

@samet-akcay
Could you please take a look into this issue? I've encountered this as well. I tried also PADIM, it worked but PatchCore failed with the above-mentioned error. Also please re-check other architecture.

@samet-akcay
Copy link
Contributor

Hi @alexriedel1 and @innat . Thanks for spotting this. @alexriedel1 if you prefer, feel free to create a PR for this to become a contributor! If not, we'll try to immediately add a fix

@samet-akcay
Copy link
Contributor

Have you guys seen this issue when you train patchcore on GPU

@alexriedel1
Copy link
Contributor Author

alexriedel1 commented Feb 23, 2022

Hi @alexriedel1 and @innat . Thanks for spotting this. @alexriedel1 if you prefer, feel free to create a PR for this to become a contributor! If not, we'll try to immediately add a fix

I did a PR . I haven't tried to reproduce the issue on GPU

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

Successfully merging a pull request may close this issue.

3 participants