Hey, I am binarizing a dataset in pytorch, and I am doing it in my test dataset, here is the code -
from google.colab import drive
drive.mount('/content/drive')
data = "/content/drive/My Drive/AMD_new"


import torch
import helper
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
import torchvision.models as models

from torchvision import datasets ,transforms


#Changning the transform of the data-
transform_train = transforms.Compose([transforms.RandomHorizontalFlip(),
                                     transforms.RandomResizedCrop(224),
                                     # transforms.CenterCrop(224),
                                     transforms.ToTensor(),
                                     transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
                                     ])

transform_test = transforms.Compose([transforms.RandomHorizontalFlip(),
                                     transforms.RandomResizedCrop(224),
                                     # transforms.CenterCrop(224),
                                     transforms.ToTensor(),
                                     transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
                                     ])

# choose the training and test datasets
train_data = datasets.ImageFolder(data+"/train", transform=transform_train)
test_data = datasets.ImageFolder(data+"/val", transform = transform_test)

dataloader_train = torch.utils.data.DataLoader(train_data, batch_size=32, shuffle=True, num_workers=2)
dataloader_test = torch.utils.data.DataLoader(test_data, batch_size=32, num_workers=2)

but when I am using these line at last, it is giving me error -
# Binarize the output
dataloader_test = label_binarize(dataloader_test, classes=[0, 1, 2, 3])
nb_classes = dataloader_test.shape[1]

Any lead on where this error comes from, as per I know it is not possible to use scikit with out binarize the data. Error is

TypeError: Singleton array array(<torch.utils.data.dataloader.DataLoader object at 0x7fc3048321d0>,
dtype=object) cannot be considered a valid collection.
It means my dataloader_test is a single object right, but how, it has four class and each class has some 10 photos. Thank you or your help.