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

Error in train_[birds/flowers].sh #3

Open
leeeeeeo opened this issue Apr 25, 2018 · 11 comments
Open

Error in train_[birds/flowers].sh #3

leeeeeeo opened this issue Apr 25, 2018 · 11 comments

Comments

@leeeeeeo
Copy link

Hello! I've done the first step: train_text_embedding_birds.sh
When I run train_birds.sh, error like below occurs:

Traceback (most recent call last):
File "train.py", line 150, in
preprocess(img, desc, len_desc, txt_encoder)
File "train.py", line 67, in preprocess
desc[sorted_indices, ...].transpose(0, 1),
File "/media/server009/seagate/liuhan/anaconda2/envs/dongiccv/lib/python2.7/site-packages/torch/autograd/variable.py", line 78, in getitem
return Index.apply(self, key)
File "/media/server009/seagate/liuhan/anaconda2/envs/dongiccv/lib/python2.7/site-packages/torch/autograd/_functions/tensor.py", line 87, in forward
result = i.index(ctx.index)
IndexError: When performing advanced indexing the indexing objects must be LongTensors or convertible to LongTensors. The indexing object at position 0 is of type numpy.ndarray and cannot be converted

Could you please help me solve this problem? @woozzu
Thank you very much !
I'm looking forward to your reply.

@woozzu
Copy link
Owner

woozzu commented Apr 26, 2018

Hi! Wrapping sorted_indices with LongTensors might solve the problem as the error message suggested. Maybe you are using a different version of pytorch.

@leeeeeeo
Copy link
Author

@woozzu Could you please tell me what's the version you used ? I'm using 0.3.0.
Thank you for your reply !

@woozzu
Copy link
Owner

woozzu commented Apr 26, 2018

0.2 as described in README.

@leeeeeeo
Copy link
Author

@woozzu I'm soooo soooorry that I missed it...
I'll try 0.2 ! Thank you !

@leeeeeeo
Copy link
Author

@woozzu I'm sorry to interrupt you again.
But I encounter the following error:

Traceback (most recent call last):
File "train.py", line 154, in
) if args.use_vgg else img_norm
File "/media/server009/seagate/liuhan/anaconda2/envs/dongiccv/lib/python2.7/site-packages/torchvision-0.2.0-py2.7.egg/torchvision/transforms/transforms.py", line 118, in call
File "/media/server009/seagate/liuhan/anaconda2/envs/dongiccv/lib/python2.7/site-packages/torchvision-0.2.0-py2.7.egg/torchvision/transforms/functional.py", line 158, in normalize
TypeError: tensor is not a torch image.

I'm not sure why this happened...
Could you please help me again...
Thank you very much !
I'm looking forward to your reply.

@woozzu
Copy link
Owner

woozzu commented Apr 27, 2018

I'm sorry that I do not know the reason.. But, at least it worked at that time.
Maybe you can try torch.stack([vgg_normalize(i) for i in img.data]) instead vgg_normalize(img.data).

@leeeeeeo
Copy link
Author

@woozzu Thank you ! It really works !
And now I'm trying to do this on my own dataset...
But I don't know how to make caption of the dataset.
Did you just use the captions from reedscot/icml2016 , it seems no further modify ?

Anyway, thanks again for your kind help !!!

@woozzu
Copy link
Owner

woozzu commented May 1, 2018

Yes, I just used the annotated dataset and I didn't modify it except visual-semantic embedding...

@tangjialiang-jj
Copy link

Hello!I have encounter a problem when I download the word vec ,the website was enable,could you please offer a new website?I will thank you so much because you help.

@woozzu
Copy link
Owner

woozzu commented Sep 30, 2019

@tangjialiang-jj Please visit this website.

@tangjialiang-jj
Copy link

@woozzu First,I am very thanks for your help,but I had encounter a problem when I run the code.When I load dataset,A problem has arisen,prompt process killed,I had install the environment by the readme.Could you please help me again?

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