Yes,I use ImageFolder. If I load the dataset in this way, can I use
for step, (images, labels) in enumerate(data_loader): 

to traverse the data in the entire dataset?
def get_base(dataset_root, batch_size, category, datatype):
    """Get Hurricane datasets loader."""
    # image pre-processing
    pre_process = transforms.Compose([transforms.Resize((224,224)),   
                                     transforms.ToTensor(),   
                                     transforms.Normalize(
                                         mean=(0.485, 0.456, 0.406),
                                         std=(0.229, 0.224, 0.225)
                                     )])

    # datasets and data_loader
    base_dataset = datasets.ImageFolder(               
        os.path.join(dataset_root, 'samples', category, datatype),
        transform=pre_process)

    base_dataloader = data.DataLoader(
        dataset=base_dataset,
        batch_size=batch_size,
        shuffle=True,
        drop_last=True,
        num_workers=4)

    return base_dataloader