Solved by ptrblck in post #3 
              
              
                The weights should be passed as sample weights (a weight is assigned to each sample), not class weights. 
Here is an example on how to use the WeightedRandomSampler.