There is extensive tutorial 9 on pytorch.org 1 about creating your own Dataset and DataLoader. You shouldn’t have problems with adapting it into your case. However, if you’ll encounter some specific difficulties feel free to ask here.