Hi,
In your WeightedRandomSampler you must specify the number of samples you want to draw during one epoch (this is not a batch_size argument), your batch_size being specify in the DataLoader.
Maybe you can try this:
sampler = WeightedRandomSampler(trainset.sample_weights, num_samples=len(trainset), replacement=False)
trainloader = DataLoader(dataset=trainset, batch_size=BATCH_SIZE, num_workers=6, sampler=sampler)
valloader   = DataLoader(dataset=valset, batch_size=BATCH_SIZE, num_workers=6, shuffle=True)