SubsetRandomSampler

I am using SubsetRandomSampler() class in pytorch to train on a subset of my data set,
I have got these problems:

  1. as dataset I use CocoDetection and my data loader seems not returning labels for all objects.
  2. how could I get the indices randomly chosen by SubsetRandomSampler from the list of indices that I provided at each batch run?