The error seems quite strange, as it points towards the used transformation, which apparently doesn’t accept any additional input arguments.
Could you load a single image and try to pass it directly to transform without the ImageFolder dataset?