-
Notifications
You must be signed in to change notification settings - Fork 95
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, int, byte or bool tensors #2
Comments
Hi, Could you show more about how you run the script and what does the error message says? Best, |
Thank you for your fast reply! These are the wrong details. |
What is your pytorch version? Probably because line 698 in barrier_track.py. Maybe try forcing the data type on every possible values? |
I meet this question too. It can be fixed by change your pytorch to version 1.10.0 |
Besides, mismatched versions of pytorch and cuda worked fine on my computer (pytorch 1.10.0 + cuda 11.7, RTX 3090)
|
I got the same error, using pytorch 1.10.0 + cuda 11.3, RTX 4090, is there any fix? |
i fixed it by adding .long() to the indices in this line, then it works with newer versions of pytorch |
Thanks! This worked for me too. |
Are you using a 4090 GPU? I tried pytorch2.1.0+cuda12.1, pytorch2.0.0+cuda11.8, and pytorch1.10.0+cuda11.3, and they all reported the same error! I'm not sure if my change to "torch.zeros_like(track_idx[0]).long()" on line 698 is correct or not. |
Based on your suggestion, I changed the .to(int) in line 737 to .long(), and added .long() after line 742 as well, and it then worked fine with the env of pytorch2.0.0+cuda11.8 on RTX4090. |
change newer version of pytorch pytorch2.0.0+cuda11.8 and add .long() |
Hi, thank you for your great job about parkour. I encountered some problems when I ran "barrier_track.py". "IndexError: tensors used as indices must be long, int, byte or bool tensors." What I need to do?
The text was updated successfully, but these errors were encountered: