am getting the following error
Getting Error: NotADirectoryError: [WinError 267] The directory name is invalid. File and folder both are valid
I am using the following code:
data_dir = os.getcwd()
folder_name = “train”
image_folders = os.path.join(data_dir, folder_name)
transform = transforms.Compose([transforms.Resize((512,512)), transforms.ToTensor()])
images = []
for file in os.listdir(image_folders):
#print(“1–>”+file)
images.append(ImageFolder(os.path.join(image_folders, file), transform=transform))
datasets = torch.utils.data.ConcatDataset(images)
Please help here.