What kind of Dataset are you passing to ConcatDataset?
Currently the implementation you’ve linked seems to only work with the MNIST dataset and ImageFolder, see this line of code 11.
You could try to implement the _get_label method for your dataset or alternatively you could try to use the built-in WeightedRandomSampler.