ntelo007:

while it should have equal length to the amount of images inside the dataset folder


That’s not the case. The length of the DataLoader is defined by the number of batches it can generate from the Dataset. In the default setup it should be ceil(len(dataset)/batch_size). If the batch size is equal to the length of your dataset, only a single batch will be returned.