Image transformations require Scipy but Scipy already installed

Hello, I’m running Tensorflow 2.4.1 on a Windows 10 computer (Python 3.8.5 with Anaconda). I’m using a NVIDIA GeForce RTX 2060 GPU with TF. I’m having problems trying to launch a CNN model using the ImageDataGenerator feeding from a Pandas dataframe. After defining the data generator and the model, I get the following error when running model.fit: “Image transformations require SciPy. Install SciPy.” However, when I can confirm that Scipy is installed by running “import scipy” without errors.

The definition of the image generator is as follows:

train_datagen = ImageDataGenerator(horizontal_flip=False,
                               vertical_flip=False,
                               rescale=1/255.0).flow_from_dataframe(dataframe=X,
                                                                    x_col='image_name',
                                                                    y_col='response',
                                                                    shuffle=False, 
                                                                    directory=src_path,
                                                                    target_size=(128, 128),
                                                                    class_mode=None
                                                                   )

And error comes when running:
model.fit(train_datagen,
epochs=5)

Please help!

PS. I believe the error results from my GPU configuration. I am running a CPU version of the code and training is running (although extremely slow). I had to change my imagegenerator declaration to:
class_mode='raw',
as I am running a regression model.

It looks like you’ve worked it out. If you need help with getting the code to train faster with your RTX 2060, let us know.

Thanks! Yes, any tips would be appreciated.

If you can share some of the code, users here may be able to see what can be optimized :+1: