I figured it out myself.
from scipy import misc
data_path = '.'
def my_loader(path):
    return misc.imread(path);
train_dataset = torchvision.datasets.ImageFolder(
    root=data_path,
    transform=torchvision.transforms.ToTensor(),
    loader = my_loader
)
train_loader = torch.utils.data.DataLoader(
    train_dataset,
    batch_size=1,
    num_workers=1,
    shuffle=True
)