I have been having issues importing apply_transform from keras.preprocessing.image. As far as I know the name has not changed according to Keras documentation. Anyone has any idea what might be the issue. I can, from the same library, import ImageDataGenerator for instance.

apply_transform has been removed from image module and has been refactored as one of the methods of ImageDataGenerator class. Instead you can define an instance of ImageDataGenerator class and use it:
from keras.preprocessing.image import ImageDataGenerator
img_gen = ImageDataGenerator()
img_gen.apply_transform(args)
or you can use apply_affine_transform() method from keras.preprocessing.image module if it satisfies your needs.
And I think you are right. The documentation is wrong about this:
keras.preprocessing.image.apply_transform(x, transform_parameters)
whereas it should be:
apply_transform(x, transform_parameters)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With