WeightedRandomSampler expects a weight tensor assigning the weight values to each sample, not the class index.
Have a look at this post which gives you an example.
WeightedRandomSampler expects a weight tensor assigning the weight values to each sample, not the class index.
Have a look at this post which gives you an example.