Hi there! And thank you for answering. I was using “compute_class_weight”  from scikit-learn like this:
class_weights = compute_class_weight(‘balanced’, np.unique(data.targets), data.targets)
then I added as you told me (classes = classes) as follows:
NUM_POSITIONS = 25
EPOCH =  17 #config.epochs
optimizer = 2 #config.optimizer
input_channels = 3
from sklearn.utils.class_weight import compute_class_weight
def load_data(root_path, batch_size):
transform1 = transforms.Compose( [transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225]),
])
transform2 = transforms.ToTensor();
data = datasets.ImageFolder(root=root_path, transform= transform1)
class_weights = compute_class_weight('balanced', np.unique(data.targets), data.targets,classes=np.arange(NUM_POSITIONS))
class_weights = []

However I’m still getting the warning… Thanks!