dong_iccv_2017 icon indicating copy to clipboard operation
dong_iccv_2017 copied to clipboard

A wrong in loaddataset.

Open tangjialiang-jj opened this issue 5 years ago • 1 comments

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!

tangjialiang-jj avatar Sep 30 '19 12:09 tangjialiang-jj

@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.

woozzu avatar Oct 01 '19 04:10 woozzu