It looks like you’re hitting the error in this file:

  

      github.com
  

  
    keras-team/keras-preprocessing/blob/master/keras_preprocessing/image/affine_transformations.py 15


    """Utilities for performing affine transformations on image data.
"""
import numpy as np

from .utils import array_to_img, img_to_array

try:
    import scipy
    # scipy.ndimage cannot be accessed until explicitly imported
    from scipy import ndimage
except ImportError:
    scipy = None

try:
    from PIL import Image as pil_image
    from PIL import ImageEnhance
except ImportError:
    pil_image = None
    ImageEnhance = None




  This file has been truncated. show original

  

  
    
    
  

  





 samiesaheb:

I managed to install SciPy into my virtual env using some commands that were written by a user in of the websites in the link you gave me, but I still ran into the same issue: ‘ImportError: Image transformations require SciPy. Install SciPy’ after doing that


From the code I linked, that doesn’t sound possible. The error is only triggered is import scipy; import scipy.ndimage fails.
Anyway, one good workaround for this is to not use keras.preprocessing since these run in python/numpy/scipy not in tensorflow. keras.layers.experimental.preprocessing contains pure-tensorflow layers that implemnent common image transformations.

  
      

      TensorFlow
  

  
    

tf.keras.layers.experimental.preprocessing.RandomRotation 7

  Randomly rotate each image.


  

  
    
    
  

  


We have several examples that use these.