Open Marium2020 opened 1 year ago
Hi,
Thanks for using CAFE. As we can see that the error message states that "IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)", which means the tensor x_out is expected to be a matrix, not a vector. Maybe there is something wrong with your data pre-processing or data-flow? A careful check on the dimension alignment between the data and the model might be quite helpful.
: )
hello,did you solve the problem?
hello,firstly,thanks yours source.I meet the same question
hello,firstly,thanks yours source.I meet the same question
I solve it.you can make the epoch/batchsize an interger number.
first,thank you,I also solve it,but anther approach.may be the tensor problem,i will try your approach.
把batch_size设置成除了64的其他数值,就可以正常运行。我分别试了60,65,128,256,512都能正常运行,只有设成64,会出现上述错误
I get the following error while running the train.py Can you suggest how to fix this? i tried x_out = torch.cat(x_out, dim=0), but that doesn't fix
Traceback (most recent call last): File "/content/drive/MyDrive/train.py", line 241, in
train()
File "/content/drive/MyDrive/train.py", line 98, in train
text_aligned_match, image_aligned_match, pred_similarity_match = similarity_module(fixed_text, matched_image)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, kwargs)
File "/content/drive/MyDrive/model.py", line 106, in forward
text_encoding, image_encoding = self.encoding(text, image)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, *kwargs)
File "/content/drive/MyDrive/model.py", line 70, in forward
text_encoding = self.shared_text_encoding(text)
File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(input, kwargs)
File "/content/drive/MyDrive/model.py", line 33, in forward
x_out = torch.cat(x_out, 1)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)