This is the simple scripts which can let you get specific label and specific number of pictures in the ImageNet dataset.
The first column of the index.txt corresponds to the label of the ImageNet,The second and the third column respectively correspond to the row index of the start and end pictures in the "train_list.txt"(you can get it in the http://www.image-net.org/)
You can run load_image.py to get specific label's dataloader.