Pytorch not recognizing directory for dataset
I'm trying to run code for a Deep Convolutional GAN from the official PyTorch site (https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html) on my Mac. 

When I try loading the data, I keep getting a "FileNotFound" error.

Random Seed:  999
---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
&lt;ipython-input-6-1019cc990fb4&gt; in &lt;module&gt;()
 78                                transforms.CenterCrop(image_size),
 79                                transforms.ToTensor(),
---&gt; 80                                transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
 81                            ]))
 82 # Create the dataloader

/anaconda3/lib/python3.6/site-packages/torchvision/datasets/folder.py in __init__(self, root, transform, target_transform, loader)
176         super(ImageFolder, self).__init__(root, loader, IMG_EXTENSIONS,
177                                           transform=transform,
--&gt; 178                                           target_transform=target_transform)
179         self.imgs = self.samples

/anaconda3/lib/python3.6/site-packages/torchvision/datasets/folder.py in __init__(self, root, loader, extensions, transform, target_transform)
 73 
 74     def __init__(self, root, loader, extensions, transform=None, target_transform=None):
---&gt; 75         classes, class_to_idx = find_classes(root)
 76         samples = make_dataset(root, class_to_idx, extensions)
 77         if len(samples) == 0:

/anaconda3/lib/python3.6/site-packages/torchvision/datasets/folder.py in find_classes(dir)
 21 
 22 def find_classes(dir):
---&gt; 23     classes = [d for d in os.listdir(dir) if os.path.isdir(os.path.join(dir, d))]
 24     classes.sort()
 25     class_to_idx = {classes[i]: i for i in range(len(classes))}

FileNotFoundError: [Errno 2] No such file or directory: 'Users/user1/Downloads/DCGANs/celeba/'


Here is where I tried loading the dataset where dataroot = "Users/user1/Downloads/DCGANs/celeba/"

The dataset is a folder (named celeba) with about 200,000 images. 

dataset = dset.ImageFolder(root=dataroot,
                       transform=transforms.Compose([
                           transforms.Resize(image_size),
                           transforms.CenterCrop(image_size),
                           transforms.ToTensor(),
                           transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
                       ]))


I tried this on both Atom and Jupyter Notebook, it didn't make a difference. 

All help is highly appreciated :)

The recognizable directory structure starts with /. So I assume, you should be replacing 

dataroot = "Users/user1/Downloads/DCGANs/celeba/"


by 

dataroot = "/Users/user1/Downloads/DCGANs/celeba/"

