Open XinCynthia opened 6 years ago
I got an IndexError when I tried to run train_text_embedding_flowers.sh, as the raw_desc in read_lua_file.py is NoneType. It has bothered me for a long time.
@rookie-zzw Could you elaborate your issue? e.g. stack traces.. I made this code long time ago, so detailed description would help me understand the issue.
@woozzu Thank you very much for your reply. Stack traces are as follows:
Traceback (most recent call last):
File "D:/code/code for Semantic Image Synthesis via Adversarial Learning/train_text_embedding.py", line 80, in
@rookie-zzw I have no problem when running it on my machine. Can you describe about your environment? e.g. python/pytorch version. And, did you accurately follow the README?
BTW, if you are interested in related projects like this, please check out our recent paper (TAGAN)
@woozzu I use python 3.5.2 and pytorch 0.4.1 on my machine, and I do follow the README. Surprising, I just read the paper you mentioned a few days ago! It is very meaningful and it is worth learning.
@rookie-zzw hmm.. that's strange. Can you confirm that raw_desc in this line is None? If so, I think the dataset might be the problem. Please double check the paths in CONFIG, or re-download the dataset.
@woozzu I tried the solution you suggested, but every time I step through that line, I get the following error: Unable to display children: Error resolving variables Trackback(most recent call last): File "C:\Program Files\JetBrains\PyCharm 2017.3\helpers\pydev_pydevd_bundle\pydevd_comm.py", line 1029, in do_it _typeName, val_dict = pydevd_vars.resolve_compound_variable(self.thread_i, self.frame_id, self.scope, self.attributes) TypeError: 'NoneType' object is not iterable
@rookie-zzw I'm sorry but I can't reproduce your error. If you can use pdb or something for debugging, printing any suspicious variables might be helpful to find the culprit.
I had the same error and and was able to fix it by copying the numpy array (the indices are thus turned positive) :
packed_desc = nn.utils.rnn.pack_padded_sequence(
desc[sorted_indices.copy(), ...].transpose(0, 1),
len_desc[sorted_indices]
I have successfully run train_text_embedding_flowers.sh, but when I run train_flowers.sh there is an error like following: Traceback (most recent call last): File "/home/xin/PycharmProjects/newcolorchage/train.py", line 149, in
preprocess(img, desc, len_desc, txt_encoder)
File "/home/xin/PycharmProjects/newcolorchage/train.py", line 68, in preprocess
desc[sorted_indices, ...].transpose(0, 1),
ValueError: some of the strides of a given numpy array are negative. This is currently not supported, but will be added in future releases.
could you please tell me why this happened? Thank you very much!