woozzu / dong_iccv_2017

A PyTorch implementation of the paper "Semantic Image Synthesis via Adversarial Learning" in ICCV 2017
MIT License
145 stars 25 forks source link

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

Open leeeeeeo opened 6 years ago

leeeeeeo commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

woozzu commented 6 years ago

0.2 as described in README.

leeeeeeo commented 6 years ago

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

leeeeeeo commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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

tangjialiang-jj commented 5 years ago

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 commented 5 years ago

@tangjialiang-jj Please visit this website.

tangjialiang-jj commented 5 years ago

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