I tried to use Amos’ DenseNet and Soumith’s ImageNet examples and replaced CIFAR10 dataset with ImageFolder dataset:
Original:

trainLoader = DataLoader(
        dset.CIFAR10(root='cifar', train=True, download=True,
                     transform=trainTransform),
        batch_size=args.batchSz, shuffle=True, **kwargs)
    testLoader = DataLoader(
        dset.CIFAR10(root='cifar', train=False, download=True,
                     transform=testTransform),
        batch_size=args.batchSz, shuffle=False, **kwargs)


Modified:

trainLoader = DataLoader(
    dset.ImageFolder(root='/home/FC/data/P/train',  transform=trainTransform),
    batch_size=args.batchSz, shuffle=True, **kwargs)
testLoader = DataLoader(
    dset.ImageFolder(root='/home/FC/data/P/val',  transform=testTransform),
    batch_size=args.batchSz, shuffle=False, **kwargs)


But loading process hangs forever.  Keyboard interrupt shows:

^CTraceback (most recent call last):
  File "train.py", line 291, in <module>
    main()
  File "train.py", line 132, in main
    train(train_loader, model, criterion, optimizer, epoch)
  File "train.py", line 157, in train
    for i, (input, target) in enumerate(train_loader):
  File "/conda3/envs/idp/lib/python3.5/site-packages/torch/utils/data/dataloader.py", line 168, in __next__
    idx, batch = self.data_queue.get()
  File "/conda3/envs/idp/lib/python3.5/queue.py", line 164, in get
    self.not_empty.wait()
  File "/conda3/envs/idp/lib/python3.5/threading.py", line 293, in wait
    waiter.acquire()
KeyboardInterrupt


What should I do to resolve this?
Folder structure is following with 2048x2048 PNGs:

/home/FC/Data/P
-> train -> classes -> images.png
-> val -> classes -> images.png