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

A wrong in loaddataset. #11

Open
tangjialiang-jj opened this issue Sep 30, 2019 · 1 comment
Open

A wrong in loaddataset. #11

tangjialiang-jj opened this issue Sep 30, 2019 · 1 comment

Comments

@tangjialiang-jj
Copy link

Sorry to bother you again, but I encountered an error loading the data:
Loading a dataset...
Traceback (most recent call last):
File "train_text_embedding.py", line 106, in
img = img[indices, ...]
File "/home/tjl/anaconda3/envs/tjl/lib/python3.6/site-packages/torch/autograd/variable.py", line 76, in getitem
return Index.apply(self, key)
File "/home/tjl/anaconda3/envs/tjl/lib/python3.6/site-packages/torch/autograd/_functions/tensor.py", line 16, in forward
result = i.index(ctx.index)
IndexError: When performing advanced indexing the indexing objects must be LongTensors or convertible to LongTensors
My pytorch version is 0.2.0 and other environments have been configured. I hope you can give me some Suggestions on how to deal with this problem!

@woozzu
Copy link
Owner

woozzu commented Oct 1, 2019

@tangjialiang-jj It seems that the type of the variable indices is not a Long type tensor. I have no idea why it does not work on your environment, but what I can tell is that the purpose of the line 106 is to sort the img tensor along the batch dimension according to indices.

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