Based on the error message, the issue is in trying to iterate transforms.Compose, which is not working:
for t in self.transforms:
    input_image=t(input_image)
    target_iage=t(target_image)

transforms.Compose will apply the transformation in the specified order, so you can use it directly:
input_image = self.transforms(input_image)