Tried to construct a tensor from a int sequence, but found an item of type float at index (0)

Was trying to fit an LSTM model that is using a pretrained language model for the Kaggle Toxic competition. However currently I’m hitting this error, and I have no clue how to proceed next. Was wondering if anyone has hit this kind of error before

Update on the issue. A probable solution as mentioned by a commenter here (RuntimeError: tried to construct a tensor from a int sequence, but found an item of type numpy.int64 at index (0) · Issue #2 · facebookresearch/InferSent · GitHub)

When you define a Field in torchtext by default it is torch.LongTensor , so you can pass whatever type you want like this data.Field(sequential=False, use_vocab=False,tensor_type=torch.cuda.FloatTensor)

So happens when I changed my code accordingly as per his suggestion (below), the error no longer appears.
tt_TEXT = data.Field(sequential=True, tokenize=tokenizer, fix_length=max_len)
tt_LABEL = data.Field(sequential=False, use_vocab=False,tensor_type=torch.cuda.FloatTensor)