Solved by spaceVStab in post #2 
              
              
                You can make use of Dataset module and further DataLoader module provided by Pytorch for feeding images to your designed network.