Thanks for your reply. I already had the transform file having different transforms hence didn’t use inbuilt torchvision one. I actually checked upon my torchvision version installed and it gives the following error
AttributeError: module 'torchvision.transforms' has no attribute 'Compose' 

But, changing *args to image in the compose function worked as required.
Thanks again!