Could you print the type and shape of temp in this line of code:
temp = torch.FloatTensor(temp)    # I tried to convert to tensor from numpy list

Do you mean “numpy array” by “numpy list”? If so, you should be able to use torch.from_numpy(temp) as long as the array contains an array with a known numerical type.