How to convert strings to tensors - PyTorch Forums
discuss.pytorch.org › t › how-to-convert-strings-toDec 30, 2020 · Hi, I am trying to create a dataset class for a problem, In that all the targets are in the form of a string like “Airplane”, “tree” etc. When I am trying to convert it into a tensor is says that TypeError: must be real number, not string, also when I am trying to convert image to tensor it says TypeError: must be real number, not JpegImageFile. Here is my code: class HolidayDataset ...