I am trying to reproduce the code implemented on

but i kept seeing this error FileNotFoundError.

The issue i believe is at the data loading stage. The original code loaded the data on dataroot = “data/celeba”. I am trying to do the same.

I created a folder celebrities_images inside which i saved the folder containing the training images named celeba and the python file is also saved in celebrities_images folder. I loading the data i used the command: dataroot = “/Celebrities_Image/celeba” but i kept getting FileNotFoundError: [Errno 2] No such file or directory: ‘/Celebrities_Image/celeba’

PS: I am working on Linux and Celebrities_Image folder in home directory


Use dataroot = “./Celebrities_Image/celeba” or dataroot = “Celebrities_Image/celeba”


I am using the following code, but it showing the FileNotFoundError. I have tried several times, but could not run the code correctly. Can anyone please fix the error?

data_dir = ‘Cat_Dog_data/train’

transform = transforms.Compose([transforms.Resize((224,224)),
dataset = datasets.ImageFolder(data_dir, transform=transform)
dataloader =, batch_size=32, shuffle=True)

Cat_Dog_data/train cannot be found on your system so you would have to verify that you are indeed in the right working directory and that the specified folder path really exists.