I have a dataset with two classes and a severe class imbalance.
I tried to use the weighed sampler to equalize the classes for training but only class showed during training. What did i do wrong?
My dataset contains individual CSV , not images.
def csv_loader(path: str) -> torch.Tensor:
    data = np.array(pd.read_csv(path, header=None))
    sample = torch.from_numpy(data)
    return sample

train_dataset = DatasetFolder(root=train_dir, loader=csv_loader, extensions=".csv")

batch_size = config.MODEL_PARAM['BATCH_SIZE']
weights =  [0.5,0.5]
sampler = torch.utils.data.sampler.WeightedRandomSampler(weights, batch_size)
    train_data_loader = DataLoader(
        train_dataset, batch_size=config.MODEL_PARAM['BATCH_SIZE'], 
        sampler = sampler, num_workers=4, drop_last=True
    )