In fact I’m reusing an already written code of a friend of mine and most important I’m new to this environment.
This code was written in Python 2 with Pytorch 0.2.0 _3 on Linux. I’m ported the code to my environment. It used to work with no problem in its previous environment.
I’m afraid of being confronted with a Pytorch problem…
This part of the code is preparing batches to LSTM for SRL…
I saw some Pytorch problems reported for sparse matrixes which are said to be fixed in 0.4.0 version but it requires migration that I would definitely prefer to stay away. As this is not my code I would be confronted with a lot of new problems during this process.
It seems the tensor is empty.
In 0.3 you can recreate the error with:
a = torch.cuda.LongTensor()
a[0]
I think you have to check, why the data is empty. Since the code was written by someone else, could you check, that all paths, directories are set to a valid location?
Maybe the data loading fails without a warning, resulting in empty tensors.