Splitting ImageFolder into train and validation datasets
I have loaded my dataset as follows :

full_dataset = ImageFolder(root = os.path.join(root, 'train'), transform=train_transforms)


Now to split my dataset into training and validation sets, I used the following code :

train_size = int(0.8 * len(full_dataset))
validation_size = len(full_dataset) - train_size
train_dataset, validation_dataset = random_split(full_dataset, [train_size, validation_size])


Both train_dataset and validation_dataset are of type : torch.utils.data.dataset.Subset. Is there any way to convert these datasets into torchvision.datasets.folder.ImageFolder. 
I need to do this as I am not able to iterate through datasets of type torch.utils.data.dataset.Subset

You should be able to iterate through a Subset just fine, since it has the __getitem__ method implemented as you can see from the source code :

class Subset(Dataset):
    r"""
    Subset of a dataset at specified indices.

    Arguments:
        dataset (Dataset): The whole Dataset
        indices (sequence): Indices in the whole set selected for subset
    """
    def __init__(self, dataset, indices):
        self.dataset = dataset
        self.indices = indices

    def __getitem__(self, idx):
        return self.dataset[self.indices[idx]]

    def __len__(self):
        return len(self.indices)


So the following should work:

for image, label in train_dataset:
    print(image, label)


Or you can create a Dataloader from a Subset:

train_dataloader = DataLoader(train_dataset, batch_size, shuffle)

for images, labels in train_dataloader:
    print(images, labels)


Same for validation_dataset.
