Hello.
I stored multiple images as below.
    for name in image_names:
        images.append(cv2.imread("./train_mini/"+name))

And I’d like to use those images in CNN training later. However, when I stored those data in “torch.utils.data.TensorDataset” like below, it shows error “RuntimeError: can’t convert a given np.ndarray to a tensor - it has an invalid type. The only supported types are: double, float, int64, int32, and uint8.” So I checked the data type of images, and it was “object”.
    train = torch.utils.data.TensorDataset(torch.from_numpy(X_train), torch.from_numpy(Y_train))

How can I solve this problem? I am completely stuck…