pytorch __init__() got an unexpected keyword argument 'train'
The error implies that it couldn't recognize the train parameter, in the ImageFolder class.
ImageFolder() does not have a parameter train, remove that it will fix the error. Instead of...
train_set = torchvision.datasets.ImageFolder(root=root,  train=True,transform=transform)

...you should have...
train_set = torchvision.datasets.ImageFolder(root=root, transform=transform).

For more check the documentation.