Train model using small subset of image in the folder

Hi everyone,
I am trying to train a neuron network, I am using the coco dataset for that, but I don’t wanna use all images because it is too large and I just wanna test the model. How can I just like using 500 images for training? and I am using pre-built dataset and dataloader from PyTorch

Here is the solution: use random_split and then feed that splitted dataset to the dataloader